minor updates to versions #92
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: Build @ironfish binaries | |
on: | |
push | |
# on: | |
# release: | |
# types: | |
# - published | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
settings: | |
- host: macos-latest | |
arch: x86_64 | |
system: apple | |
- host: windows-latest | |
arch: x86_64 | |
system: windows | |
# requires 20.04 because ironfish depends on openssl 1.1.1, new ubuntu only allows 3.x | |
- host: ubuntu-20.04 | |
arch: x86_64 | |
system: linux | |
- host: [self-hosted, macOS, ARM64] | |
arch: arm64 | |
system: apple | |
# currently no way to build arm64 | |
# - host: ubuntu-20.04 | |
# arch: aarch64 | |
# system: linux | |
# - host: ubuntu-20.04 | |
# target: aarch64-apple-darwin | |
name: Build ${{ matrix.settings.system }} ${{ matrix.settings.arch }} | |
runs-on: ${{ matrix.settings.host }} | |
steps: | |
- name: clean selfhosted node_modules | |
if: matrix.settings.system == 'apple' && matrix.settings.arch == 'arm64' | |
run: | | |
cd $GITHUB_WORKSPACE | |
find . -name . -o -prune -exec rm -rf -- {} + | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20.6' | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: create build.tar.gz for binary | |
id: build | |
run: | | |
mkdir build | |
cd build | |
npm init -y | |
npm install ironfish | |
tar -czf ../tools/build.tar.gz -C . . | |
- name: create binary | |
id: binary | |
run: | | |
go build -ldflags "-X 'main.Identifier=identifier' -X 'main.Command={{caxac}}/node --enable-source-maps {{caxac}}/node_modules/ironfish/bin/run' -X 'main.UncompressionMessage=Unpackaging ironfish application, this may take a minute when run for the first time.'" -o tools/${{ matrix.settings.system != 'windows' && 'ironfish' || 'ironfish.exe' }} tools/build-binary.go | |
- name: set paths | |
id: set_paths | |
shell: bash | |
run: | | |
echo "zip=tools/ironfish-${{ matrix.settings.system }}-${{ matrix.settings.arch }}-${{ github.event.release.tag_name }}.zip" >> $GITHUB_OUTPUT | |
echo "binary=tools/${{ matrix.settings.system != 'windows' && 'ironfish' || 'ironfish.exe' }}" >> $GITHUB_OUTPUT | |
- name: chmod binary | |
if: matrix.settings.system != 'windows' | |
run: ls && echo "FOO" && ls tools && chmod +x ${{ steps.set_paths.outputs.binary }} | |
- name: Zip binary | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: ${{ steps.set_paths.outputs.zip }} | |
path: ${{ steps.set_paths.outputs.binary }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: "${{ github.event.release.upload_url }}?name=${{ steps.set_paths.outputs.zip }}" | |
asset_path: ${{ steps.set_paths.outputs.zip }} | |
asset_name: ${{ steps.set_paths.outputs.zip }} | |
asset_content_type: application/zip |