@@ -117,32 +117,39 @@ jobs:
117
117
run : |
118
118
sudo apt-get update
119
119
sudo apt-get -y install ${{ matrix.packages }}
120
+ - name : Run sccache-cache
121
+ uses : mozilla-actions/sccache-action@v0.0.3
120
122
- name : Checkout
121
123
uses : actions/checkout@v4
122
124
- name : Setup Rust toolchain
123
125
uses : dtolnay/rust-toolchain@stable
124
126
with :
125
127
targets : ${{ matrix.target }}
126
128
- name : Cargo build
129
+ env :
130
+ SCCACHE_GHA_ENABLED : " true"
131
+ RUSTC_WRAPPER : " sccache"
127
132
run : >
128
133
cargo build --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }}
129
- --bin objdiff-cli --bin objdiff-gui --features ${{ matrix.features }}
134
+ --bin objdiff-cli --bin objdiff --features ${{ matrix.features }}
130
135
- name : Upload artifacts
131
136
uses : actions/upload-artifact@v4
132
137
with :
133
138
name : ${{ matrix.name }}
134
139
path : |
135
140
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/objdiff-cli
136
141
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/objdiff-cli.exe
137
- ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/objdiff-gui
138
- ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/objdiff-gui .exe
142
+ ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/objdiff
143
+ ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/objdiff.exe
139
144
if-no-files-found : error
140
145
141
146
release :
142
147
name : Release
143
148
if : startsWith(github.ref, 'refs/tags/')
144
149
runs-on : ubuntu-latest
145
150
needs : [ build ]
151
+ permissions :
152
+ contents : write
146
153
steps :
147
154
- name : Download artifacts
148
155
uses : actions/download-artifact@v4
@@ -151,12 +158,21 @@ jobs:
151
158
- name : Rename artifacts
152
159
working-directory : artifacts
153
160
run : |
161
+ set -euo pipefail
154
162
mkdir ../out
155
- for i in */*/$BUILD_PROFILE/objdiff-cli*; do
156
- mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/$BUILD_PROFILE\/objdiff-cli/objdiff-cli-\1/" <<< "$i")"
157
- done
158
- for i in */*/$BUILD_PROFILE/objdiff-gui*; do
159
- mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/$BUILD_PROFILE\/objdiff-gui/objdiff-\1/" <<< "$i")"
163
+ for dir in */; do
164
+ for file in "$dir"*; do
165
+ base=$(basename "$file")
166
+ name="${base%.*}"
167
+ ext="${base##*.}"
168
+ if [ "$ext" = "$base" ]; then
169
+ ext=""
170
+ else
171
+ ext=".$ext"
172
+ fi
173
+ dst="../out/${name}-${dir%/}${ext}"
174
+ mv "$file" "$dst"
175
+ done
160
176
done
161
177
ls -R ../out
162
178
- name : Release
0 commit comments