Skip to content

Commit

Permalink
Merge pull request #4492 from iron-fish/staging
Browse files Browse the repository at this point in the history
Staging to Master
  • Loading branch information
patnir committed Dec 19, 2023
2 parents 64c70d2 + 2d27708 commit e3492d3
Show file tree
Hide file tree
Showing 19 changed files with 988 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-regenerate-fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'yarn'

- name: Cache Rust
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/perf_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'yarn'

- name: Install packages
Expand Down
66 changes: 52 additions & 14 deletions .github/workflows/publish-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Build @ironfish binaries

# on:
# push
on:
release:
types:
Expand All @@ -24,7 +26,7 @@ jobs:
arch: x86_64
system: linux

- host: [self-hosted, macOS, ARM64]
- host: macos-latest-large
arch: arm64
system: apple

Expand All @@ -50,36 +52,72 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18

- name: Use Go
uses: actions/setup-go@v4
with:
go-version: '1.20.6'

- name: Checkout repository
uses: actions/checkout@v4

- name: npm init
run: npm init -y

- name: install dependencies
run: npm install ironfish [email protected]

- name: caxa package
id: caxa
- name: Create random identifier so binary extraction will be unique
id: identifier
shell: bash
run: |
npx caxa --uncompression-message "Running the CLI for the first time may take a while, please wait..." --input . --output "${{ matrix.settings.system != 'windows' && 'ironfish' || 'ironfish.exe' }}" -- "{{caxa}}/node_modules/.bin/node" "--enable-source-maps" "{{caxa}}/node_modules/ironfish/bin/run"
echo "RELEASE_NAME=ironfish-${{ matrix.settings.system }}-${{ matrix.settings.arch }}-${{ github.event.release.tag_name }}.zip"
identifier=$(awk 'BEGIN {
srand();
chars = "abcdefghijklmnopqrstuvwxyz0123456789";
for (i = 1; i <= 10; i++) {
printf "%s", substr(chars, int(rand() * length(chars)) + 1, 1);
}
print "";
}')
echo "identifier=${identifier}" >> $GITHUB_OUTPUT
- name: Create build.tar.gz for binary
id: build
run: |
mkdir build
cd build
cp $(node -e "console.log(process.execPath)") ${{ matrix.settings.system != 'windows' && 'node' || 'node.exe' }}
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=${{ steps.identifier.outputs.identifier }}' -X 'main.Command={{caxac}}/${{ matrix.settings.system != 'windows' && 'node' || 'node.exe' }} --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
- name: Set paths
id: set_paths
shell: bash
run: |
echo "zip=ironfish-${{ matrix.settings.system }}-${{ matrix.settings.arch }}-${{ github.event.release.tag_name }}.zip" >> $GITHUB_OUTPUT
name="ironfish-${{ matrix.settings.system }}-${{ matrix.settings.arch }}-${{ github.event.release.tag_name }}"
echo "name=${name}" >> $GITHUB_OUTPUT
echo "zip=${name}.zip" >> $GITHUB_OUTPUT
echo "binary=${{ matrix.settings.system != 'windows' && 'ironfish' || 'ironfish.exe' }}" >> $GITHUB_OUTPUT
- name: chmod binary
working-directory: tools
if: matrix.settings.system != 'windows'
run: chmod +x ${{ steps.set_paths.outputs.binary }}

- name: Zip binary
uses: thedoctor0/[email protected]
with:
directory: tools
type: 'zip'
filename: ${{ steps.set_paths.outputs.zip }}
filename: ${{ steps.set_paths.outputs.name }}
path: ${{ steps.set_paths.outputs.binary }}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.set_paths.outputs.name }}
path: tools/${{ steps.set_paths.outputs.zip }}
if-no-files-found: error

- name: Upload Release Asset
id: upload-release-asset
Expand Down
4 changes: 2 additions & 2 deletions ironfish-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ironfish",
"version": "1.14.0",
"version": "1.15.0",
"description": "CLI for running and interacting with an Iron Fish node",
"author": "Iron Fish <[email protected]> (https://ironfish.network)",
"main": "build/src/index.js",
Expand Down Expand Up @@ -63,7 +63,7 @@
"@aws-sdk/client-secrets-manager": "3",
"@aws-sdk/s3-request-presigner": "3",
"@ironfish/rust-nodejs": "1.12.0",
"@ironfish/sdk": "1.14.0",
"@ironfish/sdk": "1.15.0",
"@oclif/core": "1.23.1",
"@oclif/plugin-help": "5.1.12",
"@oclif/plugin-not-found": "2.3.1",
Expand Down
Loading

0 comments on commit e3492d3

Please sign in to comment.