Skip to content

Commit

Permalink
add checkout_ref for workflow dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
jowparks committed Apr 8, 2024
1 parent 5b8096a commit 68eb269
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/publish-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build @ironfish binaries

on:
workflow_dispatch:
inputs:
checkout_ref:
description: 'Git ref (branch, tag, commit SHA)'
required: false
release:
types:
- published
Expand Down Expand Up @@ -66,6 +70,14 @@ jobs:

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.checkout_ref }}

# New step to checkout tools/ directory from a different branch
- name: Checkout tools directory from different branch
run: |
git fetch origin fix-add-dispatch-param
git checkout origin/fix-add-dispatch-param tools
- name: Create random identifier so binary extraction will be unique
id: identifier
Expand All @@ -88,7 +100,7 @@ jobs:
cd build
cp $(node -e "console.log(process.execPath)") ${{ matrix.settings.system != 'windows' && 'node' || 'node.exe' }}
npm init -y
npm install ironfish@${{ github.event.release.tag_name }}
npm install ironfish@${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.checkout_ref }}
tar -czf ../tools/build.tar.gz -C . .
- name: Create binary
Expand All @@ -100,7 +112,7 @@ jobs:
id: set_paths
shell: bash
run: |
name="ironfish-standalone-${{ matrix.settings.system }}-${{ matrix.settings.arch }}-${{ github.event.release.tag_name }}"
name="ironfish-standalone-${{ matrix.settings.system }}-${{ matrix.settings.arch }}-${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.checkout_ref }}"
echo "name=${name}" >> $GITHUB_OUTPUT
echo "zip=${name}.zip" >> $GITHUB_OUTPUT
echo "binary=${{ matrix.settings.system != 'windows' && 'ironfish' || 'ironfish.exe' }}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 68eb269

Please sign in to comment.