-
Notifications
You must be signed in to change notification settings - Fork 194
105 lines (100 loc) · 3.05 KB
/
release-please.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
on:
push:
branches:
- master
name: release-please
jobs:
release-please:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.SKIM_RS_BOT_APP_ID }}
private-key: ${{ secrets.SKIM_RS_BOT_PRIVATE_KEY }}
- id: release-please
uses: googleapis/release-please-action@v4
with:
token: ${{ steps.app-token.outputs.token }}
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json
outputs:
release_created: ${{ steps.release-please.outputs.releases_created }}
tag_name: ${{ steps.release-please.outputs.skim--tag_name }}
setup-release:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
steps:
- run: |
echo '${{ needs.release-please.outputs.release_created }}'
outputs:
tag_name: ${{ needs.release-please.outputs.tag_name }}
publish-crate:
runs-on: ubuntu-latest
needs: setup-release
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install correct toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Publish to crates.io
run: cargo publish -p skim
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
build-binaries:
needs: setup-release
name: Build release binaries
permissions:
contents: write
strategy:
matrix:
arch:
- x86_64
- aarch64
- arm
- armv7
os:
- unknown-linux-musl
- apple-darwin
exclude:
- arch: arm
os: apple-darwin
- arch: armv7
os: apple-darwin
runs-on: ${{ contains(matrix.os, 'apple') && 'macos' || 'ubuntu' }}-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.arch }}-${{ matrix.os }}${{ contains(matrix.arch, 'arm') && 'eabi' || '' }}
args: "--release --locked"
- name: Create archive
env:
BIN_NAME: "sk"
ARCHIVE_NAME: "skim-${{ matrix.arch }}-${{ matrix.os }}${{ contains(matrix.arch, 'arm') && 'eabi' || '' }}.tgz"
run: |
tar -C target/*/release/ -czvf "$ARCHIVE_NAME" "$BIN_NAME"
- name: Upload binary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.setup-release.outputs.tag_name }}
ARCHIVE_NAME: "skim-${{ matrix.arch }}-${{ matrix.os }}${{ contains(matrix.arch, 'arm') && 'eabi' || '' }}.tgz"
run: |
gh release upload "$TAG" "$ARCHIVE_NAME"