-
-
Notifications
You must be signed in to change notification settings - Fork 50
77 lines (75 loc) · 2.38 KB
/
cd.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
on:
push:
tags: ['v*']
name: Continuous delivery
jobs:
test:
uses: ./.github/workflows/ci.yaml
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: [test]
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: install cargo-get
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-get
- name: set variables
run: |
# vX.Y.Z is release version
# vX.Y.Z-foo is pre-release version
VERSION=${GITHUB_REF#refs/tags/v}
VERSION_NUMBER=${VERSION%-*}
PUBLISH_OPTS=""
echo VERSION=${VERSION} >> $GITHUB_ENV
echo PUBLISH_OPTS=${PUBLISH_OPTS} >> $GITHUB_ENV
echo VERSION_NUMBER=${VERSION_NUMBER} >> $GITHUB_ENV
- name: check version integrity
run: |
ERROR=''
echo VERSION: ${VERSION}, VERSION_NUMBER: ${VERSION_NUMBER}
for dir in "." packages/apalis-{core,cron,redis,sql}; do
PACKAGE=$(cargo get package.name --entry $dir)
ACTUAL=$(cargo get package.version --entry $dir)
if [[ $VERSION != $ACTUAL ]]; then
echo ${PACKAGE}: expected version ${VERSION} but found ${ACTUAL}
ERROR=1
fi
done
if [[ $ERROR ]]; then
exit 1
fi
- name: publish apalis-core
uses: actions-rs/cargo@v1
with:
command: publish
args: ${{ env.PUBLISH_OPTS }} -p apalis-core
- name: publish apalis-cron
uses: actions-rs/cargo@v1
with:
command: publish
args: ${{ env.PUBLISH_OPTS }} -p apalis-cron
- name: publish apalis-redis
uses: actions-rs/cargo@v1
with:
command: publish
args: ${{ env.PUBLISH_OPTS }} -p apalis-redis
- name: publish apalis-sql
uses: actions-rs/cargo@v1
with:
command: publish
args: ${{ env.PUBLISH_OPTS }} -p apalis-sql --features=tokio-comp
- name: publish apalis
uses: actions-rs/cargo@v1
with:
command: publish
args: ${{ env.PUBLISH_OPTS }} -p apalis