-
Notifications
You must be signed in to change notification settings - Fork 41
feat: add new workflow to cross-compile wws #23
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
18 commits
Select commit
Hold shift + click to select a range
31431d2
feat: add new workflow to cross-compile wws
Angelmmiguel 3f081ad
feat: install missing components with rustup
Angelmmiguel 0f7cdb9
fix: configure the release action trigger to run on tags
Angelmmiguel 87f8b56
fix: install target platforms properly with rustup
Angelmmiguel 357e082
fix: set the proper matrix to build all desired flavors
Angelmmiguel f733afa
fix: skip windows on aarch64 due to the lack of cross official images
Angelmmiguel 161f2b3
fix: install musl-tools for linux builds
Angelmmiguel b1f4780
fix: remove quotes when using values in if conditional
Angelmmiguel 1db2827
fix: set the right format for conditionals with strings in the releas…
Angelmmiguel cf894f1
fix: use sudo with apt-get
Angelmmiguel f28bc28
fix: ensure we are using bash on windows too
Angelmmiguel d138c71
fix: create flat tar.gz files. Set the right file name
Angelmmiguel e530722
feat: enables the windows arm64 build
Angelmmiguel 669c15e
fix: set the -C flag properly when compressing the output files
Angelmmiguel f6eb618
chore: try to avoid using cross if not required
Angelmmiguel ea280ea
fix: continue using cross for linux aarch64
Angelmmiguel f5eb42e
feat: run only when tags are pushed and rename the file
Angelmmiguel 586b01a
fix: remove the artifact retention time that was used for testing
Angelmmiguel 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,108 @@ | ||
| name: Build artifacts | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| tags: | ||
| - "[0-9]+.[0-9]+.[0-9]+" | ||
| # TODO: uncomment for testing. This will run by default only when a new tag is created | ||
| # pull_request: | ||
| # branches: [ main ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Caching | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| target | ||
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
Angelmmiguel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Test | ||
| run: cargo test | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| build: [linux, windows, macos] | ||
| arch: [x86_64, aarch64] | ||
| include: | ||
| - build: linux | ||
| arch: x86_64 | ||
| os: ubuntu-latest | ||
| platform: unknown-linux-musl | ||
| cross: false | ||
| name: linux-musl | ||
| - build: linux | ||
| arch: aarch64 | ||
| os: ubuntu-latest | ||
| platform: unknown-linux-musl | ||
| cross: true | ||
| name: linux-musl | ||
| - build: windows | ||
| arch: x86_64 | ||
| os: windows-latest | ||
| platform: pc-windows-msvc | ||
| cross: false | ||
| name: pc-windows | ||
| - build: windows | ||
| arch: aarch64 | ||
| os: windows-latest | ||
| platform: pc-windows-msvc | ||
| cross: false | ||
| name: pc-windows | ||
| - build: macos | ||
| arch: x86_64 | ||
| os: macos-latest | ||
| platform: apple-darwin | ||
| cross: false | ||
| name: macos-darwin | ||
| - build: macos | ||
| arch: aarch64 | ||
| os: macos-latest | ||
| platform: apple-darwin | ||
| cross: false | ||
| name: macos-darwin | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| # We use cross for arm builds | ||
| CARGO: cargo | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Install cross | ||
| if: matrix.cross == true | ||
| run: | | ||
| cargo install cross | ||
| echo "CARGO=cross" >> $GITHUB_ENV | ||
| - name: Install target | ||
| if: matrix.cross == false | ||
| run: rustup target add ${{ matrix.arch }}-${{ matrix.platform }} | ||
| - name: Install deps | ||
| if: ${{ matrix.build == 'linux' }} | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install musl-tools | ||
| - name: Build | ||
| run: ${{env.CARGO}} build --verbose --release --target=${{ matrix.arch }}-${{ matrix.platform }} | ||
| - name: Tarball | ||
| shell: bash | ||
| run: | | ||
| mkdir out | ||
| cp {README.md,LICENSE} out | ||
|
|
||
| if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
| cp "target/${{ matrix.arch }}-${{ matrix.platform }}/release/wws.exe" ./out | ||
| else | ||
| cp "target/${{ matrix.arch }}-${{ matrix.platform }}/release/wws" ./out | ||
| fi | ||
|
|
||
| tar czvf "wws-${{ matrix.name }}-${{ matrix.arch }}.tar.gz" -C ./out . | ||
| echo "TARBALL=wws-${{ matrix.name }}-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: wws-${{ matrix.name }}-${{ matrix.arch }}.tar.gz | ||
| path: ${{ env.TARBALL }} | ||
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.