@@ -141,25 +141,11 @@ jobs:
141
141
steps :
142
142
- name : Checkout
143
143
uses : actions/checkout@v4
144
- with :
145
- fetch-depth : 0
146
-
147
- - name : Get sha-commit from tag
148
- id : get_baseline_sha
149
- shell : bash
150
- run : |
151
- latest_sha=$(git rev-list --tags --max-count=1)
152
- echo "sha_tag=$latest_sha" >> "$GITHUB_OUTPUT";
153
144
154
145
- name : Install Dbus
155
146
if : ${{ !matrix.cross && startsWith(matrix.os, 'ubuntu-') }}
156
147
run : sudo apt update && sudo apt install libdbus-1-dev pkg-config
157
148
158
- - name : Checkout source code to specific tag
159
- uses : actions/checkout@v4
160
- with :
161
- ref : ${{ steps.get_baseline_sha.outputs.sha_tag }}
162
-
163
149
- name : Install Nightly Rust Toolchain
164
150
uses : dtolnay/rust-toolchain@master
165
151
with :
@@ -189,12 +175,37 @@ jobs:
189
175
# ref: refs/tags/${{ needs.get-version.outputs.tag_version }}
190
176
checksum : sha256
191
177
192
- - name : Generate completions
178
+ - name : tar
179
+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' }}
180
+ run : tar -cvf lcode.tar ./target/x86_64-unknown-linux-gnu/release/lcode
181
+
182
+ - uses : actions/upload-artifact@v4
193
183
if : ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' }}
184
+ with :
185
+ name : lcode.tar
186
+ path : lcode.tar
187
+
188
+ completions :
189
+ runs-on : ubuntu-latest
190
+ needs : [build]
191
+ steps :
192
+ - uses : actions/checkout/@v4
193
+
194
+ - uses : actions/download-artifact@v4
195
+ with :
196
+ merge-multiple : true
197
+
198
+ - name : Generate completions
199
+ env :
200
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
201
+ COMMIT_MSG : |
202
+ completions(generated): update completions
194
203
run : |
195
- ./target/x86_64-unknown-linux-gnu/release/lcode --generate=zsh | tee ./completions/_lcode
196
- ./target/x86_64-unknown-linux-gnu/release/lcode --generate=bash | tee ./completions/lcode.bash
197
- ./target/x86_64-unknown-linux-gnu/release/lcode --generate=fish | tee ./completions/lcode.fish
204
+ tar -xvf lcode.tar
205
+ # git checkout main
206
+ ./lcode --generate=zsh >./completions/_lcode
207
+ ./lcode --generate=bash >./completions/lcode.bash
208
+ ./lcode --generate=fish >./completions/lcode.fish
198
209
199
210
git config user.email "actions@github"
200
211
git config user.name "Github Actions"
0 commit comments