Skip to content

Commit 5160c0a

Browse files
authored
Build and release aarch64-apple-darwin binaries (#85)
1 parent f298861 commit 5160c0a

File tree

5 files changed

+72
-46
lines changed

5 files changed

+72
-46
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,34 @@ on: [release]
44

55
jobs:
66
release:
7-
87
runs-on: ${{ matrix.os }}
98
strategy:
109
matrix:
11-
os: [macOS-latest, ubuntu-18.04]
12-
10+
os: [macos-latest, ubuntu-latest]
11+
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
12+
exclude:
13+
# Don't build linux targets on macos
14+
- os: macos-latest
15+
target: x86_64-unknown-linux-gnu
16+
# Don't build darwin targets on ubuntu
17+
- os: ubuntu-latest
18+
target: x86_64-apple-darwin
19+
- os: ubuntu-latest
20+
target: aarch64-apple-darwin
1321
steps:
14-
- uses: hecrj/[email protected]
15-
- uses: actions/checkout@v1
16-
- name: Build
17-
run: cargo build --release
22+
- uses: actions/checkout@v2
23+
- uses: actions-rs/toolchain@v1
24+
with:
25+
toolchain: stable
26+
components: rustfmt, clippy
27+
target: ${{ matrix.target }}
28+
override: true
29+
- uses: actions-rs/cargo@v1
30+
with:
31+
command: build
32+
args: --release --target ${{ matrix.target }}
1833
- uses: Shopify/upload-to-release@master
1934
with:
20-
name: shadowenv-${{ matrix.os }}
21-
path: target/release/shadowenv
35+
name: shadowenv-${{ matrix.target }}
36+
path: target/{{ matrix.target }}/release/shadowenv
2237
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rust.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [macos-latest, ubuntu-latest]
11+
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin, aarch64-apple-darwin]
12+
toolchain: [stable, nightly]
13+
exclude:
14+
# Don't test linux targets on macos
15+
- os: macos-latest
16+
target: x86_64-unknown-linux-gnu
17+
# Don't test darwin targets on ubuntu
18+
- os: ubuntu-latest
19+
target: x86_64-apple-darwin
20+
- os: ubuntu-latest
21+
target: aarch64-apple-darwin
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: ${{ matrix.toolchain }}
28+
components: rustfmt, clippy
29+
target: ${{ matrix.target }}
30+
override: true
31+
- name: fmt check
32+
run: cargo fmt --all -- --check
33+
- name: Build
34+
run: cargo build --verbose
35+
- name: Run tests
36+
run: cargo test --verbose

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
# Releasing Shadowenv
22

3-
1. Be running macOS
43
1. Bump the version in `Cargo.toml`
5-
1. Build a release with `cargo build --release`
6-
1. Manually verify that the release at `target/release/shadowenv` seems ok, at least prints the
7-
expected version with `--version`
84
1. In `default.nix` replace the `cargoSha256` value with "0000000000000000000000000000000000000000000000000000"
95
1. Run `nix build` and replace `cargoSha256` with the expected hash (which might not have changed after all)
106
1. Commit with the message "bump version to x.y.z".
117
1. Tag the commit as x.y.z (no leading 'v')
128
1. Push the commit and the tag
13-
1. `cp target/release/shadowenv shadowenv-x86_64-apple-darwin`
14-
1. Open https://github.com/Shopify/shadowenv/releases and add `shadowenv-x86_64-apple-darwin` as
15-
a file to the tag you just pushed.
9+
1. Create a new release at https://github.com/Shopify/shadowenv/releases
1610

1711
## (shopify-internal) releasing to `dev`:
1812

dev.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ name: shadowenv
22

33
up:
44
- rust
5+
- custom:
6+
name: Add rustup targets
7+
met?: rustup target add aarch64-apple-darwin x86_64-apple-darwin
8+
meet: rustup target add aarch64-apple-darwin x86_64-apple-darwin
59

610
commands:
7-
build: cargo build
8-
test: cargo test
9-
run-built: target/debug/shadowenv
10-
add-man: cp -r man/* /usr/local/share/man
11-
style: cargo fmt --all -- --check
11+
release-aarch64: cargo build --release --target aarch64-apple-darwin
12+
release-x86_64: cargo build --release --target x86_64-apple-darwin
13+
build: cargo build
14+
test: cargo test
15+
run-built: target/debug/shadowenv
16+
add-man: cp -r man/* /usr/local/share/man
17+
style: cargo fmt --all -- --check

0 commit comments

Comments
 (0)