Skip to content

Commit

Permalink
feat: auto release for browser env (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanKung authored Jul 18, 2023
1 parent 449adae commit a991cc7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
63 changes: 62 additions & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,68 @@ jobs:
path: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}.zip
retention-days: 1



build_browser:
needs: gen_version
name: build browser version binary
timeout-minutes: 25
runs-on: "ubuntu-latest"
strategy:
matrix:
arch:
- wasm32
platform:
- unknown
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get target
id: target
run: echo 'target=${{ matrix.arch }}-unknown-${{ matrix.platform }}' >> $GITHUB_OUTPUT

- name: Add target
run: |
rustup target add ${{ steps.target.outputs.target }}
- uses: jetli/[email protected]
with:
version: "0.2.84"

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Setup rust toolchain
run: |
rustup show
# If you need to reset the cache version, increment the number after `v`
- uses: Swatinem/rust-cache@v1
with:
sharedKey: auto-release-${{ steps.target.outputs.target }}-v1

- uses: actions/setup-node@v3
with:
node-version: 20

- name: Build
run: |
npm run prepare
npm pack
mv ringsnetwork-rings-node-*.tgz rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}.tgz
- uses: actions/upload-artifact@v3
name: Upload artifacts
with:
path: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}
name: rings-${{ needs.gen_version.outputs.version }}-${{ steps.target.outputs.target }}.tgz
retention-days: 1


release:
needs: [gen_version, build_macos, build_linux]
needs: [gen_version, build_macos, build_linux, build_browser]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -173,3 +233,4 @@ jobs:
rings-${{ needs.gen_version.outputs.version }}-x86_64-unknown-linux-musl/*.zip
rings-${{ needs.gen_version.outputs.version }}-x86_64-apple-darwin/*.zip
rings-${{ needs.gen_version.outputs.version }}-aarch64-apple-darwin/*.zip
rings-${{ needs.gen_version.outputs.version }}-wasm32-unknown-unknown/*.tgz
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"RND <[email protected]>"
],
"description": "Rings is a structured peer-to-peer network implementation using WebRTC, Chord algorithm, and full WebAssembly (WASM) support.\n",
"version": "0.2.5",
"version": "0.2.6",
"license": "GPL-3.0",
"repository": {
"type": "git",
Expand Down

0 comments on commit a991cc7

Please sign in to comment.