-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 2 KB
/
Copy pathrelease-please.yml
File metadata and controls
64 lines (60 loc) · 2 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
name: release-please
on:
push:
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
# Maintains a "chore: release X.Y.Z" PR from conventional commits. Merging
# that PR bumps the version, tags it, and cuts a GitHub Release.
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Only runs on the push that merges the release PR (release_created == true).
# Builds the release binary and attaches it to the fresh Release. Linux only.
upload-binaries:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
permissions:
contents: write
runs-on: ubuntu-latest
env:
TARGET: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libasound2-dev \
libwayland-dev \
libxkbcommon-dev \
pkg-config
- name: Build
run: cargo build --release --locked --target "$TARGET"
- name: Package
shell: bash
run: |
bin=ut
staging="${bin}-${{ needs.release-please.outputs.tag_name }}-${TARGET}"
mkdir "$staging"
cp "target/${TARGET}/release/${bin}" "$staging/"
cp README.md LICENSE "$staging/"
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> "$GITHUB_ENV"
- name: Upload to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ needs.release-please.outputs.tag_name }}" "$ASSET" --clobber