6
6
- " v*"
7
7
8
8
jobs :
9
- get_version :
10
- name : Get Version
11
- runs-on : ubuntu-latest
12
- outputs :
13
- version : ${{ steps.version.outputs.version }}
14
- refname : ${{ steps.refname.outputs.refname }}
15
- steps :
16
- - id : version
17
- run : echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
18
- - id : refname
19
- run : echo "refname=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
20
-
21
9
publish_pypi :
22
10
name : Publish to PyPI
23
- needs : get_version
24
11
runs-on : ubuntu-latest
25
12
environment :
26
13
name : pypi
45
32
46
33
publish_docker :
47
34
name : Publish to Docker Hub
48
- needs : get_version
49
35
runs-on : ubuntu-latest
50
36
environment :
51
37
name : dockerhub
54
40
- name : Checkout
55
41
uses : actions/checkout@v5
56
42
43
+ - name : Set version
44
+ id : version
45
+ run : echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
46
+
57
47
- name : Login to Docker Hub
58
48
uses : docker/login-action@v3
59
49
with :
@@ -73,11 +63,10 @@ jobs:
73
63
push : true
74
64
tags : |
75
65
${{ vars.DOCKERHUB_USERNAME }}/torrra:latest
76
- ${{ vars.DOCKERHUB_USERNAME }}/torrra:${{ needs.get_version .outputs.version }}
66
+ ${{ vars.DOCKERHUB_USERNAME }}/torrra:${{ steps.version .outputs.version }}
77
67
78
68
build_and_release_binaries :
79
69
name : Build on ${{ matrix.os }}
80
- needs : get_version
81
70
runs-on : ${{ matrix.os }}
82
71
strategy :
83
72
matrix :
@@ -109,43 +98,42 @@ jobs:
109
98
ARCH=$(uname -m)
110
99
111
100
if [[ "$RUNNER_OS" == "Linux" ]]; then
112
- chmod +x dist/torrra
113
- cp dist/torrra "dist-out/torrra_${{ needs.get_version.outputs.refname }}_linux_${ARCH}"
101
+ cp dist/torrra "dist-out/torrra_${GITHUB_REF_NAME}_linux_${ARCH}"
114
102
elif [[ "$RUNNER_OS" == "Windows" ]]; then
115
- cp dist/torrra.exe "dist-out/torrra_${{ needs.get_version.outputs.refname } }_windows_${ARCH}.exe"
103
+ cp dist/torrra.exe "dist-out/torrra_${GITHUB_REF_NAME }_windows_${ARCH}.exe"
116
104
elif [[ "$RUNNER_OS" == "macOS" ]]; then
117
- chmod +x dist/torrra
118
- cp dist/torrra "dist-out/torrra_${{ needs.get_version.outputs.refname }}_macos_${ARCH}"
105
+ cp dist/torrra "dist-out/torrra_${GITHUB_REF_NAME}_macos_${ARCH}"
119
106
fi
120
107
121
108
- name : Upload binary to release
122
109
uses : softprops/action-gh-release@v2
123
110
with :
124
111
files : dist-out/*
125
- token : ${{ secrets.GITHUB_TOKEN }}
126
112
127
113
publish_aur :
128
114
name : Publish to AUR
129
- needs :
130
- - get_version
131
- - build_and_release_binaries
115
+ needs : build_and_release_binaries
132
116
runs-on : ubuntu-latest
133
117
steps :
134
118
- name : Checkout
135
119
uses : actions/checkout@v5
136
120
121
+ - name : Set version
122
+ id : version
123
+ run : echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
124
+
137
125
- name : Publish torrra to AUR
138
126
uses : stabldev/aur-publish-action@v1
139
127
with :
140
128
pkgname : torrra
141
- pkgver : ${{ needs.get_version .outputs.version }}
129
+ pkgver : ${{ steps.version .outputs.version }}
142
130
pkgbuild_template : ./pkgbuild-template/torrra/PKGBUILD
143
131
aur_ssh_private_key : ${{ secrets.AUR_SSH_PRIVATE_KEY }}
144
132
145
133
- name : Publish torrra-bin to AUR
146
134
uses : stabldev/aur-publish-action@v1
147
135
with :
148
136
pkgname : torrra-bin
149
- pkgver : ${{ needs.get_version .outputs.version }}
137
+ pkgver : ${{ steps.version .outputs.version }}
150
138
pkgbuild_template : ./pkgbuild-template/torrra-bin/PKGBUILD
151
139
aur_ssh_private_key : ${{ secrets.AUR_SSH_PRIVATE_KEY }}
0 commit comments