-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- upload binary artifacts to GH release page - publish NPM packages
- Loading branch information
1 parent
12b7288
commit b72d4ac
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
name: "Push" | ||
on: | ||
release: | ||
types: | ||
- created | ||
push: | ||
branches: | ||
- main | ||
|
@@ -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 }} | ||
|
@@ -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" | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
@@ -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 |