-
Notifications
You must be signed in to change notification settings - Fork 15
Build on all supported platforms in standard CI run #478
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
908e8d7
Build on all supported platforms in standard CI run
adamtroiani 68e1488
build is done in parallel with other jobs
adamtroiani 5aad225
fixed formatting, removed unneeded fields from matrix variables
adamtroiani b366d8d
test publish workflow
adamtroiani de995c2
Consolidated building and publishing into one workflow
adamtroiani b16f580
reverted to old design with should_publish variable introduced
adamtroiani d90adcd
removed instances of github.event.release.tag_name from build-and-pub…
adamtroiani c93df26
removed comments - ready for pr
adamtroiani e049638
removed workflow dispatch from default ci triggers
adamtroiani 70c2edf
refactored workflows: build and publish happen in separate jobs
adamtroiani 488ac5a
commented out lines for testing
adamtroiani 9ce8564
recursively search artifacts directory instead of looking for files i…
adamtroiani 5cba887
simplifying artifact directory structure
adamtroiani 7276669
simplified artifact path
adamtroiani ef4dbbb
reverted back to old asset paths
adamtroiani 92d1d8a
fixed asset name
adamtroiani ce15501
removed debug statements and uncommented lines
adamtroiani 293a80a
use github output variables instead of searching for assets
adamtroiani 4f51182
test
adamtroiani 29c1eac
simplified artifact release uploads
adamtroiani 6dac12a
added should_upload_artifacts boolean to build workflow
adamtroiani efc2d1b
added conditional to all build steps that are only used in publish wo…
adamtroiani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| tag_name: | ||
| description: "Tag name" | ||
| required: true | ||
| type: string | ||
| should_upload_artifacts: | ||
| description: "Should upload artifacts" | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - name: x86_64-unknown-linux-gnu | ||
| os: ubuntu-22.04 | ||
| path: target/x86_64-unknown-linux-gnu/release/function-runner | ||
| asset_name: function-runner-x86_64-linux-${{ inputs.tag_name }} | ||
| shasum_cmd: sha256sum | ||
| - name: aarch64-unknown-linux-gnu | ||
| os: ubuntu-22.04 | ||
| path: target/aarch64-unknown-linux-gnu/release/function-runner | ||
| asset_name: function-runner-arm-linux-${{ inputs.tag_name }} | ||
| shasum_cmd: sha256sum | ||
| - name: x86_64-apple-darwin | ||
| os: macos-latest | ||
| path: target/x86_64-apple-darwin/release/function-runner | ||
| asset_name: function-runner-x86_64-macos-${{ inputs.tag_name }} | ||
| shasum_cmd: shasum -a 256 | ||
| - name: aarch64-apple-darwin | ||
| os: macos-latest | ||
| path: target/aarch64-apple-darwin/release/function-runner | ||
| asset_name: function-runner-arm-macos-${{ inputs.tag_name }} | ||
| shasum_cmd: shasum -a 256 | ||
| - name: x86_64-pc-windows-msvc | ||
| os: windows-latest | ||
| path: target\x86_64-pc-windows-msvc\release\function-runner.exe | ||
| asset_name: function-runner-x86_64-windows-${{ inputs.tag_name }} | ||
| shasum_cmd: sha256sum | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install cross compiler | ||
| if: ${{ matrix.name == 'aarch64-unknown-linux-gnu' }} | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gcc-aarch64-linux-gnu | ||
|
|
||
| - name: Set up cross compiler env variables | ||
| if: ${{ matrix.name == 'aarch64-unknown-linux-gnu' }} | ||
| run: | | ||
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | ||
| echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | ||
| echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV | ||
|
|
||
| - name: Install target | ||
| run: rustup target add ${{ matrix.name }} | ||
|
|
||
| - name: Build ${{ matrix.name }} | ||
| run: cargo build --release --target ${{ matrix.name }} --package function-runner | ||
|
|
||
| - name: Archive assets | ||
| if: ${{ inputs.should_upload_artifacts }} | ||
| run: gzip -k -f ${{ matrix.path }} && mv ${{ matrix.path }}.gz ${{ matrix.asset_name }}.gz | ||
|
|
||
| - name: Upload assets to artifacts | ||
| if: ${{ inputs.should_upload_artifacts }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.asset_name }}.gz | ||
| path: ${{ matrix.asset_name }}.gz | ||
|
|
||
| - name: Generate asset hash | ||
| if: ${{ inputs.should_upload_artifacts }} | ||
| run: ${{ matrix.shasum_cmd }} ${{ matrix.asset_name }}.gz | awk '{ print $1 }' > ${{ matrix.asset_name }}.gz.sha256 | ||
|
|
||
| - name: Upload asset hash to artifacts | ||
| if: ${{ inputs.should_upload_artifacts }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.asset_name }}.gz.sha256 | ||
| path: ${{ matrix.asset_name }}.gz.sha256 | ||
adamtroiani marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.