-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade the project to alpha * create publishing scripts * swig workflow * basic publishing scripts * publishing scripts * wire the build to the npm install command * skip binaries when linting * avoid cmd multi-line syntax * optional build cache
- Loading branch information
Showing
12 changed files
with
383 additions
and
48 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
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,168 @@ | ||
name: Publish | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
prerelease: | ||
type: boolean | ||
default: false | ||
description: whether the release should be marked as a prerelease | ||
|
||
jobs: | ||
swig: | ||
name: Generate the SWIG wrappers | ||
uses: | ||
./.github/workflows/swig.yml | ||
|
||
|
||
build-native: | ||
name: Build native ${{ matrix.platform && '' || '' }} | ||
needs: swig | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: ubuntu-20.04 | ||
id: linux-x64 | ||
- platform: macos-latest | ||
id: darwin-arm64 | ||
- platform: macos-12 | ||
id: darwin-x64 | ||
- platform: windows-2019 | ||
id: windows-x64 | ||
|
||
uses: | ||
./.github/workflows/build.yml | ||
with: | ||
platform: ${{ matrix.platform }} | ||
native: true | ||
wasm: false | ||
id: ${{ matrix.id }} | ||
enable_tiff: true | ||
|
||
|
||
build-wasm: | ||
name: Build WASM | ||
needs: swig | ||
|
||
uses: | ||
./.github/workflows/build.yml | ||
with: | ||
platform: ubuntu-latest | ||
native: false | ||
wasm: true | ||
enable_tiff: true | ||
inline_projdb: false | ||
id: emscripten-wasm32 | ||
|
||
|
||
create-release: | ||
name: Create the Github release | ||
runs-on: ubuntu-latest | ||
needs: [ build-native, build-wasm ] | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
draft: true | ||
prerelease: ${{ inputs.prerelease }} | ||
|
||
|
||
pack-prebuilt-binaries: | ||
name: Pack the prebuilt binaries | ||
runs-on: ubuntu-latest | ||
needs: [ create-release ] | ||
permissions: | ||
contents: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [linux-x64, win32-x64, darwin-x64, darwin-arm64, emscripten-wasm32] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Download the artifact for ${{ matrix.platform }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ matrix.platform }} | ||
path: lib/binding | ||
|
||
- name: Pack | ||
run: | ||
tar -zcvf ${{ matrix.platform }}.tar.gz lib/binding | ||
|
||
- name: Publish | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifacts: ${{ matrix.platform }}.tar.gz | ||
updateOnlyUnreleased: true | ||
omitDraftDuringUpdate: true | ||
omitPrereleaseDuringUpdate: true | ||
|
||
|
||
create-npm-package: | ||
name: Create the npm package | ||
runs-on: ubuntu-latest | ||
needs: [ build-native, build-wasm ] | ||
permissions: | ||
contents: write | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- name: Download the SWIG-generated wrappers | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: swig | ||
path: swig | ||
- run: npm pack | ||
- name: Get version | ||
id: version | ||
run: node -p '"version=" + require("./package.json").version' >> "$GITHUB_OUTPUT" | ||
- name: Upload the npm package | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifacts: proj.js-${{ steps.version.outputs.version }}.tgz | ||
updateOnlyUnreleased: true | ||
omitDraftDuringUpdate: true | ||
omitPrereleaseDuringUpdate: true | ||
|
||
|
||
publish-release: | ||
name: Publish the Github release | ||
runs-on: ubuntu-latest | ||
needs: [ create-npm-package, pack-prebuilt-binaries ] | ||
steps: | ||
- name: Publish the draft release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
omitDraftDuringUpdate: false | ||
draft: false | ||
omitPrereleaseDuringUpdate: true | ||
|
||
|
||
test_package: | ||
name: Test the npm package | ||
uses: ./.github/workflows/test-package.yml | ||
needs: [ publish-release, create-npm-package ] | ||
with: | ||
package: proj.js-${{ needs.create-npm-package.outputs.version }}.tgz | ||
download: true |
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,36 @@ | ||
name: Generate the SWIG wrappers | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
swig: | ||
runs-on: ubuntu-latest | ||
name: Generate the SWIG wrappers | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- uses: mmomtchev/setup-swig@main | ||
with: | ||
branch: jse | ||
version: main | ||
cache: false | ||
|
||
- name: Verify SWIG | ||
run: swig-jse -version | ||
|
||
- name: Run SWIG to generate the wrappers | ||
run: npm run swig | ||
|
||
- name: Upload SWIG-generated wrappers | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: swig-generated | ||
path: | | ||
swig/* |
Oops, something went wrong.