fix the windows env var with the right step #335
Workflow file for this run
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 | |
on: | |
push: | |
branches: | |
- main | |
- jg/nodecli-release-test | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tag: | |
name: Tag | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
if: github.ref == 'refs/heads/jg/nodecli-release-test' | |
outputs: | |
createdTag: ${{ steps.create-tag.outputs.tag }} | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Create tag | |
id: create-tag | |
uses: salsify/action-detect-and-tag-new-version@v2 | |
with: | |
version-command: cat airbyte-local-cli-nodejs/package.json | jq -r '.version' | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
platform: [x64, arm64] | |
exclude: | |
- os: windows-latest | |
platform: arm64 | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
needs: [tag] | |
# Only run if the tag was created | |
if: needs.tag.outputs.createdTag != null | |
permissions: | |
contents: write | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
- name: Install | |
working-directory: airbyte-local-cli-nodejs | |
shell: bash | |
run: | | |
npm ci --no-audit --no-fund | |
npm run version | |
- name: Package for Platform | |
working-directory: airbyte-local-cli-nodejs | |
shell: bash | |
run: | | |
if [ "${{ runner.os }}" == 'Windows' ]; then | |
TARGET="win-${{ matrix.platform }}" | |
BINARY_NAME="airbyte-local.exe" | |
else | |
TARGET="${{ runner.os == 'macOS' && 'macos' || 'linux' }}-${{ matrix.platform }}" | |
BINARY_NAME="airbyte-local" | |
fi | |
echo "TARGET=$TARGET" >> $GITHUB_ENV | |
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV | |
echo "Building for $TARGET with binary name $BINARY_NAME" | |
npm run pkg-ci -- --target $TARGET --output ./out/pkg/$BINARY_NAME | |
- name: Compress Linux/MacOS binaries | |
working-directory: airbyte-local-cli-nodejs/out/pkg | |
if: runner.os != 'Windows' | |
run: | | |
zip airbyte-local-${TARGET}.zip airbyte-local | |
- name: Compress Windows binaries | |
working-directory: airbyte-local-cli-nodejs/out/pkg | |
if: runner.os == 'Windows' | |
run: | | |
Compress-Archive -Path airbyte-local.exe -DestinationPath airbyte-local-win-x64.zip | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release_${{ env.TARGET }} | |
path: airbyte-local-cli-nodejs/out/pkg/airbyte-local-${{ env.TARGET }}.zip | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: [tag, build] | |
steps: | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: airbyte-local-cli-nodejs/out/pkg | |
- name: List Downloaded Binaries | |
run: | | |
ls -R airbyte-local-cli-nodejs/out/pkg | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
airbyte-local-cli-nodejs/out/pkg/release_linux-x64/airbyte-local-linux-x64.zip | |
airbyte-local-cli-nodejs/out/pkg/release_linux-arm64/airbyte-local-linux-arm64.zip | |
airbyte-local-cli-nodejs/out/pkg/release_macos-x64/airbyte-local-macos-x64.zip | |
airbyte-local-cli-nodejs/out/pkg/release_macos-arm64/airbyte-local-macos-arm64.zip | |
airbyte-local-cli-nodejs/out/pkg/release_win-x64/airbyte-local-win-x64.zip | |
tag_name: ${{ needs.tag.outputs.createdTag }} |