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

Commit

Permalink
feat: add platform and arch bin releasing
Browse files Browse the repository at this point in the history
Signed-off-by: Yordis Prieto <[email protected]>
  • Loading branch information
yordis committed Oct 29, 2023
1 parent 63d7cff commit 1e080fb
Showing 1 changed file with 89 additions and 4 deletions.
93 changes: 89 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
Expand Down Expand Up @@ -30,8 +31,8 @@ jobs:
args: --all-features

windows_build:
runs-on: windows-latest-8-cores
needs: [cargo_check]
runs-on: windows-latest
needs: []
steps:
- uses: actions/checkout@v4
- name: Compile wash
Expand All @@ -42,10 +43,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: [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 +133,14 @@ jobs:
id: create_release
uses: softprops/action-gh-release@v1
with:
files: release/windows/wash.exe
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

0 comments on commit 1e080fb

Please sign in to comment.