-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (75 loc) · 2.61 KB
/
Copy pathcd.yml
File metadata and controls
90 lines (75 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get version
id: get_version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Install Rust
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: stable
profile: minimal
override: true
- name: Setup toolchain
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Build binary for x86_64-apple-darwin
run: cargo build --release --target x86_64-apple-darwin
env:
RUST_BACKTRACE: 1
- name: Build binary for aarch64-apple-darwin
run: cargo build --release --target aarch64-apple-darwin
env:
RUST_BACKTRACE: 1
- name: Strip binary
run: |
strip "target/x86_64-apple-darwin/release/appcu"
strip "target/aarch64-apple-darwin/release/appcu"
- name: Test binary
run: |
./target/x86_64-apple-darwin/release/appcu -V
- name: Build archive
shell: bash
run: |
tar -czf appcu-x86_64-apple-darwin.tar.gz -C target/x86_64-apple-darwin/release/ appcu
tar -czf appcu-aarch64-apple-darwin.tar.gz -C target/aarch64-apple-darwin/release/ appcu
- name: Set SHA
if: matrix.os == 'macos-latest'
id: shasum
run: |
echo ::set-output name=sha::"$(shasum -a 256 ./{{ steps.get_version.outputs.version }}.tar.gz | awk '{printf $1}')"
- name: Extract release notes
id: release_notes
uses: ffurrer2/extract-release-notes@v1
- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.release_notes.outputs.release_notes }}
prerelease: ${{ contains(github.ref, '-') }}
files: |
appcu-x86_64-apple-darwin.tar.gz
appcu-aarch64-apple-darwin.tar.gz
- name: Bump homebrew-core formula
uses: mislav/bump-homebrew-formula-action@v2
if: "!contains(github.ref, '-')"
with:
homebrew-tap: chengluffy/homebrew-appcu
formula-name: appcu
download-url: https://github.com/ChengLuffy/application_check_update/archive/refs/tags/${{ steps.get_version.outputs.version }}.tar.gz
create-pullrequest: true
env:
COMMITTER_TOKEN: ${{ secrets.BREW_TOKEN }}