Skip to content

Commit 3118495

Browse files
authored
Merge pull request #63 from pact-foundation/feat/musl_static_win_aarch64
feat: linux musl static bins / windows aarch64
2 parents b7e4aba + efa86ca commit 3118495

12 files changed

+631
-386
lines changed

.github/workflows/release.yml

+91-13
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,115 @@ on:
44
release:
55
types: [published]
66

7+
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: release-${{ github.ref }}
13+
cancel-in-progress: true
14+
715
jobs:
816
build-release:
917
runs-on: ${{ matrix.operating-system }}
1018
strategy:
1119
matrix:
12-
operating-system: [ubuntu-latest, windows-latest, macos-latest]
20+
include:
21+
- operating-system: ubuntu-20.04
22+
targets: x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,aarch64-unknown-linux-gnu,aarch64-unknown-linux-musl
23+
- operating-system: windows-2019
24+
targets: aarch64-pc-windows-msvc,x86_64-pc-windows-msvc
25+
- operating-system: macos-12
26+
targets: aarch64-apple-darwin,x86_64-apple-darwin
27+
fail-fast: false
1328
steps:
14-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v4
30+
1531
- name: Install stable Rust toolchain
16-
uses: actions-rs/toolchain@v1
32+
uses: dtolnay/rust-toolchain@stable
1733
with:
18-
profile: minimal
1934
toolchain: stable
20-
override: true
21-
target: aarch64-apple-darwin
35+
targets: ${{ matrix.targets }}
36+
37+
- name: Rust caching
38+
uses: Swatinem/rust-cache@v2
39+
with:
40+
workspaces: rust
41+
42+
- name: Set up QEMU
43+
if: runner.os == 'Linux'
44+
uses: docker/setup-qemu-action@v3
45+
46+
- name: Set up Docker Buildx
47+
if: runner.os == 'Linux'
48+
uses: docker/setup-buildx-action@v3
49+
50+
- name: Cargo flags
51+
id: cargo-flags
52+
shell: bash
53+
run: |
54+
if [[ "${{ github.event_name }}" = "release" ]]; then
55+
echo "flags=--release" >> "$GITHUB_OUTPUT"
56+
else
57+
echo "flags=" >> "$GITHUB_OUTPUT"
58+
fi
59+
2260
- name: Install LLVM
2361
run: choco install -y llvm
2462
if: runner.os == 'Windows'
25-
- if: runner.os == 'Linux'
26-
run: ./scripts/release-linux.sh
27-
- if: runner.os == 'Windows'
28-
run: ./scripts/release-win.sh
29-
shell: bash
30-
- if: runner.os == 'macOS'
31-
run: ./scripts/release-osx.sh
63+
64+
- name: build and release ${{ runner.os }}
65+
run: ./release.sh ${{ runner.os }} ${{ steps.cargo-flags.outputs.flags }}
3266
shell: bash
67+
3368
- name: Upload Release Assets
69+
if: |
70+
startsWith(github.ref, 'refs/tags/v')
3471
id: upload-release-asset
3572
uses: svenstaro/upload-release-action@v2
3673
with:
3774
repo_token: ${{ secrets.GITHUB_TOKEN }}
3875
file: release_artifacts/*
3976
file_glob: true
4077
tag: ${{ github.ref }}
78+
79+
release_docker:
80+
runs-on: ubuntu-latest
81+
needs: build-release
82+
if: |
83+
startsWith(github.ref, 'refs/tags/v')
84+
85+
steps:
86+
- uses: actions/checkout@v3
87+
with:
88+
fetch-depth: 0
89+
90+
- name: Log into ghcr registry
91+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
92+
with:
93+
registry: ghcr.io
94+
username: ${{ github.actor }}
95+
password: ${{ secrets.GITHUB_TOKEN }}
96+
97+
- name: Log into docker registry
98+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
99+
with:
100+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
101+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
102+
103+
- name: Set up QEMU
104+
uses: docker/setup-qemu-action@v3
105+
106+
- name: push_image
107+
id: cargo-flags
108+
shell: bash
109+
run: |
110+
if [[ "${{ github.event_name }}" = "release" ]]; then
111+
echo "PUSH_IMAGE=true" >> "$GITHUB_ENV"
112+
fi
113+
114+
- name: Release image
115+
run: cd docker && hooks/build
116+
env:
117+
DOCKER_TAG: ${{ github.ref }}
118+
PUSH_IMAGE: ${{ env.PUSH_IMAGE }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Cargo
22
# will have compiled files and executables
33
/target/
4+
# Generated Release Artifacts
45
release_artifacts
56
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
67
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock

0 commit comments

Comments
 (0)