Skip to content

Commit

Permalink
Continuing the experiment: remove neon-actions/build from build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dherman committed Mar 16, 2024
1 parent f9a215c commit e679e87
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ jobs:
script: |
const platforms = ${{ steps.matrixData.outputs.json }};
const macOS = platforms.macOS.map(platform => {
return { os: "macos-latest", platform, cross: false };
return { os: "macos-latest", platform, script: "build" };
});
const windows = platforms.Windows.map(platform => {
return { os: "windows-latest", platform, cross: false };
return { os: "windows-latest", platform, script: "build" };
});
const linux = platforms.Linux.map(platform => {
return { os: "ubuntu-latest", platform, cross: true };
return { os: "ubuntu-latest", platform, script: "cross" };
});
return [...macOS, ...windows, ...linux];
Expand All @@ -102,6 +102,8 @@ jobs:
path: ./.github/workflows/.env
export-variables: true
keys-case: bypass
- name: Setup Neon Toolchain
uses: ./.github/actions/setup-neon
- name: Diagnostics
shell: bash
run: git log -10
Expand All @@ -118,25 +120,36 @@ jobs:
- name: Check Versions
shell: bash
run: ./test/lint/check-versions.sh
- name: Compute Rust Target
id: target
shell: bash
run: echo target=$(node ../../dist/cli list-platforms | jq -r '.["${{ matrix.cfg.platform }}"]') >> $GITHUB_OUTPUT
working-directory: ./pkgs/cargo-messages
- name: Build
id: build
uses: neon-actions/[email protected]
with:
working-directory: ./pkgs/cargo-messages
node-version: ${{ env.NODE_VERSION }}
use-cross: ${{ !!matrix.cfg.cross }}
platform: ${{ matrix.cfg.platform }}
shell: bash
env:
CARGO_BUILD_TARGET: ${{ steps.target.outputs.target }}
NEON_BUILD_PLATFORM: ${{ matrix.cfg.platform }}
run: npm run ${{ matrix.cfg.script }}
working-directory: ./pkgs/cargo-messages
- name: Pack
id: pack
shell: bash
run: |
mkdir -p dist
echo filename=$(basename $(npm pack ./platforms/${{ matrix.cfg.platform }} --pack-destination=./dist --json | jq -r '.[0].filename')) >> $GITHUB_OUTPUT
working-directory: ./pkgs/cargo-messages
- name: Diagnostics
shell: bash
run: |
echo 'inputs.ref=${{ inputs.ref }}'
echo 'steps.build.outputs.filename=${{ steps.build.outputs.filename }}'
ls -al ./pkgs/cargo-messages/dist/${{ steps.build.outputs.filename }}
echo 'steps.build.outputs.filename=${{ steps.pack.outputs.filename }}'
ls -al ./pkgs/cargo-messages/dist/${{ steps.pack.outputs.filename }}
- name: Release
if: ${{ inputs.github-release }}
uses: softprops/action-gh-release@v1
with:
files: ./pkgs/cargo-messages/dist/${{ steps.build.outputs.filename }}
files: ./pkgs/cargo-messages/dist/${{ steps.pack.outputs.filename }}
tag_name: ${{ inputs.tag }}

main:
Expand Down

0 comments on commit e679e87

Please sign in to comment.