Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Publish binaries for noir-profiler #7443

Merged
merged 8 commits into from
Feb 20, 2025
96 changes: 85 additions & 11 deletions .github/workflows/publish-nargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,33 @@ jobs:
- name: Build environment and Compile
run: |
cargo build --package nargo_cli --release --target ${{ matrix.target }} --no-default-features --features "${{ inputs.features }}"

cargo build --package noir_profiler --release --target ${{ matrix.target }} --no-default-features --features "${{ inputs.features }}"

- name: Package artifacts
run: |
mkdir dist
cp ./target/${{ matrix.target }}/release/nargo ./dist/nargo
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-${{ matrix.target }}.tar.gz
cp ./target/${{ matrix.target }}/release/noir-profiler ./dist/noir-profiler

# TODO(https://github.com/noir-lang/noir/issues/7445): Remove the separate nargo binary
tar -czf nargo-${{ matrix.target }}.tar.gz -C dist nargo
tar -czf noir-${{ matrix.target }}.tar.gz -C dist .

- name: Upload artifact
- name: Upload nargo artifact
uses: actions/upload-artifact@v4
with:
name: nargo-${{ matrix.target }}
path: ./dist/*
retention-days: 3

- name: Upload binaries to release tag
- name: Upload Noir binaries artifact
uses: actions/upload-artifact@v4
with:
name: noir-${{ matrix.target }}
path: ./dist/*
retention-days: 3

- name: Upload nargo binaries to release tag
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.publish || github.event_name == 'schedule' }}
with:
Expand All @@ -84,12 +96,23 @@ jobs:
overwrite: true
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)

- name: Upload Noir binaries to release tag
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.publish || github.event_name == 'schedule' }}
with:
repo_name: noir-lang/noir
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./noir-${{ matrix.target }}.tar.gz
asset_name: noir-${{ matrix.target }}.tar.gz
overwrite: true
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)

- name: Get formatted date
id: date
if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }}
run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Upload binaries to release with date tag
- name: Upload nargo binaries to release with date tag
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }}
with:
Expand All @@ -102,6 +125,19 @@ jobs:
overwrite: true
tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }}

- name: Upload Noir binaries to release with date tag
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.tag == '' && inputs.publish || github.event_name == 'schedule' }}
with:
repo_name: noir-lang/noir
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./noir-${{ matrix.target }}.tar.gz
asset_name: noir-${{ matrix.target }}.tar.gz
prerelease: true
make_latest: false
overwrite: true
tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }}

build-linux:
runs-on: ubuntu-22.04
env:
Expand Down Expand Up @@ -135,23 +171,36 @@ jobs:
with:
tool: cross@0.2.5

- name: Build Nargo
run: cross build --package nargo_cli --release --target=${{ matrix.target }} --no-default-features --features "${{ inputs.features }}"
- name: Build binaries
run: |
cross build --package nargo_cli --release --target=${{ matrix.target }} --no-default-features --features "${{ inputs.features }}"
cross build --package noir_profiler --release --target=${{ matrix.target }} --no-default-features --features "${{ inputs.features }}"

- name: Package artifacts
run: |
mkdir dist
cp ./target/${{ matrix.target }}/release/nargo ./dist/nargo
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-${{ matrix.target }}.tar.gz
cp ./target/${{ matrix.target }}/release/noir-profiler ./dist/noir-profiler

- name: Upload artifact
# TODO(https://github.com/noir-lang/noir/issues/7445): Remove the separate nargo binary
tar -czf nargo-${{ matrix.target }}.tar.gz -C dist nargo
tar -czf noir-${{ matrix.target }}.tar.gz -C dist .

- name: Upload nargo artifact
uses: actions/upload-artifact@v4
with:
name: nargo-${{ matrix.target }}
path: ./dist/*
retention-days: 3

- name: Upload binaries to release tag
- name: Upload Noir binaries artifact
uses: actions/upload-artifact@v4
with:
name: noir-${{ matrix.target }}
path: ./dist/*
retention-days: 3

- name: Upload nargo binaries to release tag
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.publish }}
with:
Expand All @@ -163,12 +212,24 @@ jobs:
overwrite: true
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)

- name: Upload Noir binaries to release tag
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.publish }}
with:
repo_name: noir-lang/noir
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./noir-${{ matrix.target }}.tar.gz
asset_name: noir-${{ matrix.target }}.tar.gz
prerelease: true
overwrite: true
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)

- name: Get formatted date
id: date
if: ${{ env.NIGHTLY_RELEASE && inputs.publish }}
run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Upload binaries to release with date tag
- name: Upload nargo binaries to release with date tag
uses: svenstaro/upload-release-action@v2
if: ${{ env.NIGHTLY_RELEASE && inputs.publish }}
with:
Expand All @@ -181,4 +242,17 @@ jobs:
overwrite: true
tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }}

- name: Upload Noir binaries to release with date tag
uses: svenstaro/upload-release-action@v2
if: ${{ env.NIGHTLY_RELEASE && inputs.publish }}
with:
repo_name: noir-lang/noir
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./noir-${{ matrix.target }}.tar.gz
asset_name: noir-${{ matrix.target }}.tar.gz
prerelease: true
make_latest: false
overwrite: true
tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }}


Loading