-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (153 loc) · 5.87 KB
/
release.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Release
permissions:
attestations: write
contents: write
id-token: write
on:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
CARGO_PROFILE_RELEASE_LTO: true
CARGO_PROFILE_RELEASE_OPT_LEVEL: 2
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CC: clang
RUSTFLAGS: -D warnings -Clink-arg=-Wl,--compress-debug-sections=zlib
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
jobs:
cargo-about:
if: github.repository_owner == 'VorpalBlade' && (startsWith(github.event.release.name, 'paketkoll-v') || startsWith(github.event.release.name, 'konfigkoll-v'))
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Rust
run: rustup update stable && rustup default stable && rustup component add clippy
- name: Get cargo-binstall
run: |
curl -L https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | tar -zxf - && mv cargo-binstall $HOME/.cargo/bin/
- name: Install required cargo addons
run: cargo binstall --no-confirm --no-symlinks cargo-about
- run: mkdir target && cargo about generate about.hbs > target/licenses.html
- name: Upload licenses.html
run: GITHUB_TOKEN="${token}" gh release upload "${tag}" target/licenses.html --clobber
env:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
upload-paketkoll:
name: "paketkoll: ${{ matrix.target }}"
if: github.repository_owner == 'VorpalBlade' && startsWith(github.event.release.name, 'paketkoll-v')
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- target: aarch64-unknown-linux-musl
- target: armv7-unknown-linux-musleabihf
- target: i686-unknown-linux-musl
- target: riscv64gc-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cross
- uses: taiki-e/upload-rust-binary-action@v1.21.1
id: upload-rust-binary-action
with:
bin: paketkoll
target: ${{ matrix.target }}
# Include version number.
archive: $bin-$tag-$target
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: "${{ steps.upload-rust-binary-action.outputs.archive }}.*"
upload-konfigkoll:
name: "konfigkoll: ${{ matrix.target }}"
if: github.repository_owner == 'VorpalBlade' && startsWith(github.event.release.name, 'konfigkoll-v')
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- target: aarch64-unknown-linux-musl
- target: armv7-unknown-linux-musleabihf
- target: i686-unknown-linux-musl
- target: riscv64gc-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cross
- uses: taiki-e/upload-rust-binary-action@v1.21.1
id: upload-rust-binary-action
with:
bin: konfigkoll,konfigkoll-rune
target: ${{ matrix.target }}
# Include version number.
archive: konfigkoll-$tag-$target
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: "${{ steps.upload-rust-binary-action.outputs.archive }}.*"
upload-aur-paketkoll:
if: github.repository_owner == 'VorpalBlade' && startsWith(github.event.release.name, 'paketkoll-v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get AUR repo
run: git clone https://aur.archlinux.org/paketkoll.git aur
- name: Update PKGBUILD
run: |
sed -i '/^_pkgver/s/=.*$/='${RELEASE_TAG#refs/tags/paketkoll-v}'/' "aur/PKGBUILD"
sed -i '/^pkgrel/s/=.*$/=1/' "aur/PKGBUILD"
env:
RELEASE_TAG: ${{ github.ref }}
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
with:
pkgname: paketkoll
pkgbuild: aur/PKGBUILD
updpkgsums: true
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: New upstream release (automatic update from GitHub Actions)
upload-aur-konfigkoll:
if: github.repository_owner == 'VorpalBlade' && startsWith(github.event.release.name, 'konfigkoll-v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get AUR repo
run: git clone https://aur.archlinux.org/konfigkoll.git aur
- name: Update PKGBUILD
run: |
sed -i '/^_pkgver/s/=.*$/='${RELEASE_TAG#refs/tags/konfigkoll-v}'/' "aur/PKGBUILD"
sed -i '/^pkgrel/s/=.*$/=1/' "aur/PKGBUILD"
env:
RELEASE_TAG: ${{ github.ref }}
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
with:
pkgname: konfigkoll
pkgbuild: aur/PKGBUILD
updpkgsums: true
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: New upstream release (automatic update from GitHub Actions)