-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into dd/gh-net-release
- Loading branch information
Showing
15 changed files
with
258 additions
and
248 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: '[js] CI' | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled] | ||
branches: [master] | ||
paths: | ||
- 'js/**' | ||
- 'package.json' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Cancel previous workflow runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Install: NodeJS 20.x' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: 'Install: dependencies' | ||
run: yarn install | ||
|
||
- name: 'Prepare: build all' | ||
run: yarn build | ||
|
||
- name: 'Prepare: fmt' | ||
run: yarn lint | ||
|
||
- name: 'Prepare: download Gear node' | ||
run: | | ||
wget -O ./gear https://github.com/gear-tech/gear/releases/download/build/gear | ||
chmod +x gear | ||
- name: 'Prepare: run Gear node' | ||
run: nohup ./gear --dev --execution=wasm --tmp --unsafe-rpc-external --rpc-methods Unsafe --rpc-cors all & | ||
|
||
- name: 'Prepare: sleep 3 min' | ||
run: sleep 180 | ||
|
||
- name: 'Test: run' | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: '[js] Release' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- package.json | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Setup NodeJS 20.x' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: 'Get info' | ||
id: info | ||
run: | | ||
VERSION=$(jq -r '.version' package.json) | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
echo "tag_name=js/v$VERSION" >> $GITHUB_OUTPUT | ||
PREVIOUS_VERSION=$(npm show @js/package version) | ||
echo "prev_version=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT | ||
- name: 'Compare versions' | ||
id: release | ||
run: | | ||
if [ ${{ steps.info.outputs.version }} == ${{ steps.info.outputs.prev_version }} ]; then | ||
echo "No new version to release" | ||
echo "skip=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "New version to release" | ||
echo "skip=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: 'Get release notes' | ||
id: release_notes | ||
if: steps.release.outputs.skip != 'true' | ||
run: | | ||
awk '/## ${{ steps.info.outputs.version }}/{flag=1;next}/---/{flag=0} flag' ./js/CHANGELOG.md >> release_notes.txt | ||
echo "release_notes<<EOF" >> $GITHUB_OUTPUT | ||
cat release_notes.txt >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
rm release_notes.txt | ||
- name: 'Prepare: install dependencies and build pkgs' | ||
if: steps.release.outputs.skip != 'true' | ||
run: | | ||
yarn install | ||
yarn build | ||
- name: 'Create new tag' | ||
if: steps.release.outputs.skip != 'true' | ||
run: | | ||
git tag ${{ steps.info.outputs.tag_name }} | ||
git push origin ${{ steps.info.outputs.tag_name }} | ||
- name: 'Create Release' | ||
if: steps.release.outputs.skip != 'true' | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
body: ${{ steps.release_notes.outputs.release_notes }} | ||
tag_name: ${{ steps.info.outputs.tag_name }} | ||
name: 'Sails-JS v${{ steps.info.outputs.version }}' | ||
|
||
- name: 'Publish to npm registry' | ||
if: steps.release.outputs.skip != 'true' | ||
run: | | ||
export token=$(printenv npm_token) | ||
echo "//registry.npmjs.org/:_authToken=$token" > .npmrc | ||
npx lerna publish from-package --yes --no-private | ||
env: | ||
npm_token: ${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# CHANGELOG | ||
|
||
## 0.3.1 (draft) | ||
|
||
### Compatibility | ||
- Sails-RS v0.6.3 | ||
|
||
### Changes | ||
- Setup automated releases in https://github.com/gear-tech/sails/pull/608 |
Oops, something went wrong.