Skip to content

Commit

Permalink
Improve build binaries pipeline
Browse files Browse the repository at this point in the history
Changes made:
- build macOS arm and x86
- rename architecture from amd64 to x86_64, which is much easier to distinct from arm
- remove unnecessary step for self-hosted which is not being used anymore
- create ARTIFACT_NAME env var, so it's much easier to read the code
- remove unnecessary id
  • Loading branch information
derrix060 committed Sep 5, 2024
1 parent c0008d7 commit 9562d16
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ jobs:
matrix:
include:
- os: ubuntu-latest
architecture: amd64
- os: macOS-latest
architecture: amd64
architecture: x86_64
- os: macos-13
architecture: x86_64
- os: ubuntu-arm64-4-core
architecture: arm64
- os: macos-latest
architecture: arm64
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -27,9 +29,11 @@ jobs:
fetch-depth: 0

- name: Get latest tag
id: tag
run: echo "TAG=$(git describe --tags)" >> $GITHUB_ENV

- name: Get artifact name
run: echo "ARTIFACT_NAME=juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}" >> $GITHUB_ENV

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update -qq && sudo apt-get install -y upx-ucl build-essential cargo git golang libjemalloc-dev libjemalloc2 -y
Expand All @@ -47,27 +51,21 @@ jobs:
run: |
make juno
upx build/juno
mv build/juno juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}
mv build/juno ${{ env.ARTIFACT_NAME }}
- name: Generate Checksum
id: checksum
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
shasum -a 256 juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} > juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256
shasum -a 256 ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.sha256
else
sha256sum juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} > juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256
sha256sum ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.sha256
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}
name: ${{ env.ARTIFACT_NAME }}
path: |
juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}
juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256
- name: Cleanup
if: matrix.os == 'self-hosted'
run: |
rm juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}
rm juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256
${{ env.ARTIFACT_NAME }}
${{ env.ARTIFACT_NAME }}.sha256

0 comments on commit 9562d16

Please sign in to comment.