Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

feat: add platform and arch bin releasing #955

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 86 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,87 @@ jobs:
name: windows
path: target/release/wash.exe

build_bin:
strategy:
matrix:
config:
- target: aarch64-apple-darwin
install-path: /bin/wash
test-bin: file ./result/bin/wash
test-oci: docker load < ./result

- target: aarch64-linux-android
install-path: /bin/wash
test-bin: file ./result/bin/wash
test-oci: docker load < ./result

- target: aarch64-unknown-linux-musl
install-path: /bin/wash
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/wash --version
test-oci: docker load < ./result
# TODO: Run aarch64 binary within OCI

- target: x86_64-apple-darwin
install-path: /bin/wash
test-bin: file ./result/bin/wash
test-oci: docker load < ./result

- target: x86_64-pc-windows-gnu
install-path: /bin/wash.exe
test-bin: nix shell --inputs-from . 'nixpkgs#wine64' -c wine64 ./result/bin/wash.exe --version
test-oci: docker load < ./result
# TODO: Run win64 binary within OCI

- target: x86_64-unknown-linux-musl
install-path: /bin/wash
test-bin: ./result/bin/wash --version
test-oci: |
docker load < ./result
docker run --rm wash:$(nix eval --raw .#wash-x86_64-unknown-linux-musl-oci.imageTag) wash --version

name: wash-${{ matrix.config.target }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-nix
with:
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: ./.github/actions/build-nix
with:
package: wash-${{ matrix.config.target }}
install-path: ${{ matrix.config.install-path }}
- run: ${{ matrix.config.test-bin }}
- uses: ./.github/actions/build-nix
with:
package: wash-${{ matrix.config.target }}-oci
- run: ${{ matrix.config.test-oci }}

release:
needs: [cargo_check, clippy_check, windows_build]
needs: [cargo_check, clippy_check, windows_build, build_bin]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/[email protected]
- uses: actions/download-artifact@v3
with:
name: wash-aarch64-apple-darwin
- uses: actions/download-artifact@v3
with:
name: wash-aarch64-linux-android
- uses: actions/download-artifact@v3
with:
name: wash-aarch64-unknown-linux-musl
- uses: actions/download-artifact@v3
with:
name: wash-x86_64-apple-darwin
- uses: actions/download-artifact@v3
with:
name: wash-x86_64-pc-windows-gnu
- uses: actions/download-artifact@v3
with:
name: wash-x86_64-unknown-linux-musl
- run: chmod +x ./wash-*
# We need to put windows on the release so that chocolatey can download it
- name: Download windows release
uses: actions/download-artifact@v3
Expand All @@ -55,7 +132,14 @@ jobs:
id: create_release
uses: softprops/action-gh-release@v1
with:
files: release/windows/wash.exe
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is x86_64-pc-windows-gnu binary the same as the one from windows_build?

files: |
release/windows/wash.exe
wash-aarch64-apple-darwin
wash-aarch64-linux-android
wash-aarch64-unknown-linux-musl
wash-x86_64-apple-darwin
wash-x86_64-pc-windows-gnu
wash-x86_64-unknown-linux-musl
generate_release_notes: true
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
Expand Down