-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (65 loc) · 2.19 KB
/
publish.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
name: Publish
on:
pull_request:
types:
- closed
jobs:
if_publish:
if: |
github.event.pull_request.merged == true
&& startsWith(github.event.pull_request.head.ref, 'release-')
&& startsWith(github.event.pull_request.title, 'Release')
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: "main"
- name: Config Git
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install cargo binary dependencies
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-release
- name: Prepare Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.0
if: matrix.name == 'Linux' || matrix.name == 'Android'
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Install dependencies
if: matrix.name == 'Linux' || matrix.name == 'Android'
run: |
sudo apt-get update -y -qq
sudo apt install -y libasound2-dev libudev-dev
- name: Generate Cargo lock
run: cargo generate-lockfile
- name: Get New version
id: gettag
run: |
echo "TAG_NAME=$(cargo pkgid | cut -d# -f2 | cut -d@ -f2)" >> $GITHUB_OUTPUT
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ steps.gettag.outputs.TAG_NAME }}
path: ./CHANGELOG.md
- name: Release publish
run: cargo release publish --execute --no-confirm --workspace --exclude pong
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Create a Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.gettag.outputs.TAG_NAME }}
body: ${{ steps.changelog_reader.outputs.changes }}