Skip to content

Commit

Permalink
ci: add release steps
Browse files Browse the repository at this point in the history
- upload binary artifacts to GH release page
- publish NPM packages
  • Loading branch information
pborzenkov committed Oct 9, 2023
1 parent 12b7288 commit b72d4ac
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: "Push"
on:
release:
types:
- created
push:
branches:
- main
Expand Down Expand Up @@ -72,6 +75,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- id: release
uses: bruceadams/[email protected]
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
Expand Down Expand Up @@ -107,6 +115,17 @@ jobs:
path: target/${{ matrix.target }}/release/${{ matrix.soname }}
if-no-files-found: error

- name: Upload release
uses: actions/[email protected]
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: target/${{ matrix.target }}/release/litevfs-${{ env.VERSION }}-${{ matrix.target }}.tar.gz
asset_name: litevfs-${{ env.VERSION }}-${{ matrix.target }}.tar.gz
asset_content_type: application/gzip

build-wasm:
name: "Build WASM"
runs-on: "ubuntu-latest"
Expand All @@ -116,6 +135,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- id: release
uses: bruceadams/[email protected]
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-emscripten
Expand Down Expand Up @@ -146,6 +170,17 @@ jobs:
path: target/sqlite3-wasm
if-no-files-found: error

- name: Upload release
uses: actions/[email protected]
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: target/sqlite3-wasm-${{ env.VERSION }}.tar.gz
asset_name: sqlite3-wasm-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip

build-npm:
name: "Build NPM packages"
runs-on: "ubuntu-latest"
Expand Down Expand Up @@ -179,3 +214,13 @@ jobs:
name: npm-packages-${{ env.VERSION }}
path: target/npm
if-no-files-found: error

- name: Publish NPM packages
if: github.event_name == 'release'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd target/npm
for p in litevfs-*.tgz; do
npm publish $p
done

0 comments on commit b72d4ac

Please sign in to comment.