Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dd/gh-net-release
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisInSky committed Nov 27, 2024
2 parents d0a14a0 + eeef504 commit 6877982
Show file tree
Hide file tree
Showing 15 changed files with 258 additions and 248 deletions.
100 changes: 0 additions & 100 deletions .github/workflows/ci-js.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/js-ci.yml
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
80 changes: 80 additions & 0 deletions .github/workflows/js-release.yml
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 }}
97 changes: 0 additions & 97 deletions .github/workflows/net-build-client-gen.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/net-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,48 @@ jobs:
path: |
net/**/*.trx
!net/**/Sails.Tests.Shared/**/*.trx
build_win_x64:
name: Build Native Libraries for Win x64
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Build & Test Client Generator
run: |
cargo test --locked --manifest-path net/rs/Cargo.toml --release
build_linux_x64:
name: Build Native Libraries for Linux x64
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Build & Test Client Generator
run: |
cargo test --locked --manifest-path net/rs/Cargo.toml --release
build_osx_x64:
name: Build Native Libraries for NacOS x64
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Build & Test Client Generator
run: |
rustup target add x86_64-apple-darwin
cargo test --locked --manifest-path net/rs/Cargo.toml --release --target x86_64-apple-darwin
build_osx_arm64:
name: Build Native Libraries for MacOS ARM64
runs-on: macos-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Build & Test Client Generator
run: |
rustup target add aarch64-apple-darwin
cargo test --locked --manifest-path net/rs/Cargo.toml --release --target aarch64-apple-darwin
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ net/**/*.trx
node_modules/
js/**/lib/
js/cli/build/
js/parser/parser.wasm
js/test/demo/
.pnp.*
.yarn/*
Expand Down
9 changes: 9 additions & 0 deletions js/CHANGELOG.md
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
Loading

0 comments on commit 6877982

Please sign in to comment.