-
Notifications
You must be signed in to change notification settings - Fork 10
90 lines (83 loc) · 2.19 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: write # To write to release
id-token: write # To deploy to GitHub Pages
pages: write # To deploy to GitHub Pages
jobs:
crate:
runs-on: ubuntu-latest
environment: crate
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
docker:
runs-on: ubuntu-latest
environment: docker
needs:
- info
steps:
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
push: true
tags: 1915keke/commitlint-rs:${{ needs.info.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
info:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.info.outputs.tag }}
steps:
- id: info
run: echo tag=$(echo $GITHUB_REF | cut -d / -f 3 | sed -e 's/v//') >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
needs:
- crate
- docker
- web
steps:
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
web:
runs-on: ubuntu-latest
environment:
name: web
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: withastro/action@v0
with:
path: ./web
- id: deployment
uses: actions/deploy-pages@v2