@@ -3,7 +3,7 @@ name: release
3
3
on :
4
4
push :
5
5
tags :
6
- - ' v[0-9]+.[0-9]+.[0-9]+ '
6
+ - " v* "
7
7
8
8
jobs :
9
9
create_release :
@@ -71,27 +71,31 @@ jobs:
71
71
os : ubuntu-18.04
72
72
rust : stable
73
73
target : x86_64-unknown-linux-musl
74
+ arch : x86_64
74
75
strip : strip
75
76
- build : linux-armv7
76
77
os : ubuntu-18.04
77
78
rust : stable
78
79
target : armv7-unknown-linux-gnueabihf
80
+ arch : armv7
79
81
strip : arm-linux-gnueabihf-strip
80
82
- build : linux-aarch64
81
83
os : ubuntu-18.04
82
84
rust : stable
83
85
target : aarch64-unknown-linux-musl
86
+ arch : aarch64
84
87
strip : aarch64-linux-musl-strip
85
88
- build : macos
86
89
os : macOS-latest
87
90
rust : stable
88
91
target : x86_64-apple-darwin
92
+ arch : x86_64
89
93
strip : strip
90
94
# - build: macos-aarch64
91
95
# os: macOS-latest
92
96
# rust: stable
93
97
# target: aarch64-apple-darwin
94
- # strip: strip
98
+ # strip: strip
95
99
96
100
steps :
97
101
- name : Checkout repository
@@ -139,21 +143,40 @@ jobs:
139
143
- name : Strip release binary (arm)
140
144
if : matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
141
145
run : |
142
- docker run --rm -v \
143
- "$PWD/target:/target:Z" \
146
+ docker run --rm -v $PWD/target:/target:Z \
144
147
rustembedded/cross:${{ matrix.target }} \
145
- ${{ matrix.strip }} \
146
- /target/${{ matrix.target }}/release/phpup
148
+ ${{ matrix.strip }} /target/${{ matrix.target }}/release/phpup
149
+
150
+ - name : Generate completion files
151
+ if : matrix.build == 'linux' || matrix.build == 'macos'
152
+ run : |
153
+ mkdir -p completions/{bash,zsh}
154
+ ./target/${{ matrix.target }}/release/phpup completions --shell bash > completions/bash/_phpup
155
+ ./target/${{ matrix.target }}/release/phpup completions --shell zsh > completions/zsh/_phpup
156
+
157
+ - name : Generate completion files (arm)
158
+ if : matrix.build == 'linux-armv7' || matrix.build == 'linux-aarch64'
159
+ uses : uraimo/run-on-arch-action@v2.1.1
160
+ with :
161
+ arch : ${{ matrix.arch }}
162
+ distro : ubuntu20.04
163
+ githubToken : ${{ github.token }}
164
+ dockerRunArgs : |
165
+ -v $PWD/target:/target:Z \
166
+ -v $PWD/completions:/completions:Z
167
+ run : |
168
+ mkdir -p completions/{bash,zsh}
169
+ ./target/${{ matrix.target }}/release/phpup completions --shell bash > completions/bash/_phpup
170
+ ./target/${{ matrix.target }}/release/phpup completions --shell zsh > completions/zsh/_phpup
147
171
148
172
- name : Build archive
149
173
shell : bash
150
174
run : |
151
175
staging=phpup-${{ matrix.build }}
152
- mkdir -p $staging/completions/{bash,zsh}
176
+ mkdir $staging
153
177
cp {README.md,LICENSE} $staging/
154
178
cp target/${{ matrix.target }}/release/phpup $staging/
155
- $staging/phpup completions --shell bash > $staging/completions/bash/_phpup
156
- $staging/phpup completions --shell zsh > $staging/completions/zsh/_phpup
179
+ cp -r completions $staging/
157
180
zip -r $staging.zip $staging
158
181
echo "ASSET=$staging.zip" >> $GITHUB_ENV
159
182
0 commit comments