Adding node 18.19.0 to release 0.3.0 #110
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
name: CI for nexe builds | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
# Create nexe build for later use | |
build_and_publish: | |
name: Build nexe | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 180 | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
# TODO: Bump to windows-latest once it can be solved how to install Python2 | |
# such that the Node.js build system can detect it. | |
os: [ubuntu-latest, windows-2019, macos-latest] | |
#node_version: ['14.16.0', '14.18.0', '14.18.1', '16.11.0', '16.13.0', '16.13.1', '16.19.0', '18.14.0', '18.19.0'] | |
node_version: ['18.19.0'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js from .nvmrc | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Declare caches for build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.ccache/ | |
key: ${{ matrix.os }}-${{ matrix.node_version }} | |
- run: npm ci | |
- name: Run nexe CD build | |
id: run_cd | |
run: | | |
echo "github.ref = ${{ github.ref }}" | |
./bin/run_cd | |
echo "Creating dist/ dir if it doesn't exist ..." | |
mkdir -p dist/ | |
echo "Getting release_file and release_id ..." | |
release_file="$(ls dist/ | head -n 1)" | |
release_name="$(cat ./NEXE_ASSET_NAME)" | |
release_id="$(cat ./RELEASE_ID)" | |
echo "Getting build_occurred ..." | |
if [ "$release_file" != "" ]; then | |
build_occurred="true" | |
else | |
build_occurred="false" | |
fi | |
echo "release_id=$release_id" | |
echo "release_file=$release_file" | |
echo "release_name=$release_name" | |
echo "build_occurred=$build_occurred" | |
echo "release_id=$release_id" >> $GITHUB_OUTPUT | |
echo "release_file=$release_file" >> $GITHUB_OUTPUT | |
echo "release_name=$release_name" >> $GITHUB_OUTPUT | |
echo "build_occurred=$build_occurred" >> $GITHUB_OUTPUT | |
env: | |
NODE_VERSION: ${{ matrix.node_version }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CREATE_RELEASE: "${{ github.ref == 'refs/heads/main' && 'true' || 'false' }}" | |
# Upload artifact & asset | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
if: steps.run_cd.outputs.build_occurred == 'true' | |
with: | |
name: ${{ steps.run_cd.outputs.release_name }} | |
path: dist/${{ steps.run_cd.outputs.release_file }} | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
if: steps.run_cd.outputs.build_occurred == 'true' && github.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: https://uploads.github.com/repos/urbdyn/nexe_builds/releases/${{ steps.run_cd.outputs.release_id }}/assets{?name,label} | |
asset_name: ${{ steps.run_cd.outputs.release_name }} | |
asset_path: dist/${{ steps.run_cd.outputs.release_file }} | |
asset_content_type: application/octet-stream |