-
-
Notifications
You must be signed in to change notification settings - Fork 49
98 lines (80 loc) · 2.77 KB
/
deploy.yml
File metadata and controls
98 lines (80 loc) · 2.77 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
91
92
93
94
95
96
97
98
name: Deploy
on:
push:
tags:
- "v*"
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy rustfmt
- name: Install wayland dependencies
run: |
pacman -Syu --noconfirm egl-wayland egl-gbm wayland base-devel mesa pango cairo github-cli git
- name: Build
run: cargo build --workspace --release
publish-crate:
runs-on: ubuntu-latest
container:
image: archlinux:latest
permissions:
contents: write
id-token: write
needs: build
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy rustfmt
- name: Install wayland dependencies
run: |
pacman -Syu --noconfirm egl-wayland egl-gbm wayland base-devel mesa pango cairo github-cli git
- name: Obtain crates.io token
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
id: auth
- name: Publish to crates.io
run: |
cargo publish -p libwayshot
cargo publish -p wayshot
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
CARGO_PUBLISH: true
github-release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
needs: publish-crate
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: taiki-e/create-gh-release-action@eba8ea96c86cca8a37f1b56e94b4d13301fba651 # v1.11.0
with:
branch: main
changelog: CHANGELOG.md
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish github release
run: |
if [[ $(echo "${GITHUB_REF#refs/tags/v}" | grep '-' > /dev/null) ]]; then
gh release edit "${GITHUB_REF#refs/tags/}" --prerelease
fi
gh release edit "${GITHUB_REF#refs/tags/}" --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}