Commit c3e6188 1 parent 91aca8b commit c3e6188 Copy full SHA for c3e6188
File tree 2 files changed +27
-31
lines changed
2 files changed +27
-31
lines changed Original file line number Diff line number Diff line change 25
25
needs : cargo-deny
26
26
steps :
27
27
- uses : actions/checkout@v3
28
- with :
29
- fetch-depth : 0
30
28
- uses : actions-rs/toolchain@v1
31
29
with :
32
30
toolchain : stable
35
33
- uses : actions-rs/cargo@v1
36
34
with :
37
35
command : test
38
- - name : Extract version from Cargo.toml
39
- id : extract_version
40
- run : |
41
- VERSION=$(grep '^version = ' Cargo.toml | sed -E 's/version = "(.*)"/\1/')
42
- echo "VERSION=$VERSION" >> $GITHUB_ENV
43
-
44
- - name : Check if tag exists
45
- id : check_tag
46
- run : |
47
- if git rev-parse --verify v${VERSION} >/dev/null 2>&1; then
48
- echo "TAG_EXISTS=true" >> $GITHUB_ENV
49
- else
50
- echo "TAG_EXISTS=false" >> $GITHUB_ENV
51
- fi
52
-
53
- - name : Create new tag
54
- if : ${{ env.TAG_EXISTS == 'false' }}
55
- run : |
56
- git config --global user.name "${{ github.actor }}"
57
- git config --global user.email "noreply@turingpi.com"
58
- git tag -a "v${{ env.VERSION }}" -m "Release version ${{ env.VERSION }}"
59
- git push origin "v${{ env.VERSION }}"
60
- env :
61
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
1
name : Release Pipeline
2
2
on :
3
3
push :
4
- tags :
5
- - ' v[0-9]+.[0-9]+.[0-9]+'
6
- jobs :
4
+ branches :
5
+ - master
7
6
7
+ jobs :
8
8
build-pipeline :
9
9
name : " Build ${{ matrix.target }}"
10
10
strategy :
@@ -122,17 +122,39 @@ jobs:
122
122
name : ${{ env.PKG_NAME }}.deb
123
123
path : ${{ env.PKG_NAME }}.deb
124
124
125
- create_release :
126
- needs : debian-packages
125
+ create-release :
127
126
runs-on : ubuntu-latest
127
+ needs : build-pipeline
128
128
steps :
129
129
- name : Checkout Code
130
130
uses : actions/checkout@v4
131
+ with :
132
+ fetch-depth : 0
131
133
- name : Extract version from Cargo.toml
134
+ id : extract_version
132
135
run : |
133
136
VERSION=$(grep '^version = ' Cargo.toml | sed -E 's/version = "(.*)"/\1/')
134
137
echo "VERSION=$VERSION" >> $GITHUB_ENV
135
138
139
+ - name : Check if tag exists
140
+ id : check_tag
141
+ run : |
142
+ if git rev-parse --verify v${VERSION} >/dev/null 2>&1; then
143
+ echo "TAG_EXISTS=true" >> $GITHUB_ENV
144
+ else
145
+ echo "no new version detected, aborting release Pipeline"
146
+ exit 0
147
+ fi
148
+
149
+ - name : Create new tag
150
+ run : |
151
+ git config --global user.name "${{ github.actor }}"
152
+ git config --global user.email "noreply@turingpi.com"
153
+ git tag -a "v${{ env.VERSION }}" -m "Release version ${{ env.VERSION }}"
154
+ git push origin "v${{ env.VERSION }}"
155
+ env :
156
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
157
+
136
158
- name : Download artifacts
137
159
uses : actions/download-artifact@v4
138
160
with :
You can’t perform that action at this time.
0 commit comments