@@ -128,29 +128,57 @@ jobs:
128
128
- name : Create the rules archive
129
129
run : |
130
130
# Update urls and sha256 values
131
- bazel ${BAZEL_STARTUP_FLAGS[@]} run //crate_universe/tools/urls_generator -- --artifacts-dir="${ARTIFACTS_DIR}" --url-prefix="${URL_PREFIX}"
131
+ bazel ${BAZEL_STARTUP_FLAGS[@]} run //crate_universe/tools/urls_generator \
132
+ -- --artifacts-dir="${ARTIFACTS_DIR}" --url-prefix="${URL_PREFIX}"
133
+
132
134
bazel clean
135
+
133
136
# Build an archive of the repo contents.
134
137
# `examples/bzlmod` is included for the BCR presubmit; it must appear before --exclude="examples"
135
- tar -czf ${{ github.workspace }}/.github/rules_rust.tar.gz -C ${{ github.workspace }} --exclude=".git" --exclude=".github" --exclude="crate_universe/target" examples/bzlmod --exclude="examples" .
138
+ tar -czf ${{ github.workspace }}/.github/rules_rust.tar.gz \
139
+ -C ${{ github.workspace }} \
140
+ --exclude=".git" --exclude=".github" \
141
+ --exclude="crate_universe/target" \
142
+ examples/bzlmod \
143
+ --exclude="examples" \
144
+ --exclude="extensions" \
145
+ .
146
+
136
147
# Save the sha256 checksum of the distro archive to the environment
137
148
sha256_base64="$(shasum --algorithm 256 ${{ github.workspace }}/.github/rules_rust.tar.gz | awk '{ print $1 }' | xxd -r -p | base64)"
138
149
echo "ARCHIVE_SHA256_BASE64=${sha256_base64}" >> $GITHUB_ENV
139
150
env :
140
151
CARGO_BAZEL_GENERATOR_URL : file://${{ github.workspace }}/crate_universe/target/artifacts/x86_64-unknown-linux-gnu/cargo-bazel
141
152
ARTIFACTS_DIR : ${{ github.workspace }}/crate_universe/target/artifacts
142
153
URL_PREFIX : https://github.com/${{ github.repository_owner }}/rules_rust/releases/download/${{ env.RELEASE_VERSION }}
154
+ - name : Create the rules extensions archive
155
+ run : |
156
+ # Build an archive of the repo contents.
157
+ tar -czf ${{ github.workspace }}/.github/rules_rust_ext.tar.gz \
158
+ -C ${{ github.workspace }}/extensions \
159
+ --exclude="examples" \
160
+ .
161
+
162
+ # Save the sha256 checksum of the distro archive to the environment
163
+ sha256_base64="$(shasum --algorithm 256 ${{ github.workspace }}/.github/rules_rust_ext.tar.gz | awk '{ print $1 }' | xxd -r -p | base64)"
164
+ echo "ARCHIVE_EXT_SHA256_BASE64=${sha256_base64}" >> $GITHUB_ENV
143
165
# Upload the artifact in case creating a release fails so all artifacts can then be manually recovered.
144
166
- uses : actions/upload-artifact@v3
145
167
with :
146
168
name : " rules_rust.tar.gz"
147
169
path : ${{ github.workspace }}/.github/rules_rust.tar.gz
148
170
if-no-files-found : error
171
+ - uses : actions/upload-artifact@v3
172
+ with :
173
+ name : " rules_rust_ext.tar.gz"
174
+ path : ${{ github.workspace }}/.github/rules_rust_ext.tar.gz
175
+ if-no-files-found : error
149
176
- name : Generate release notes
150
177
run : |
151
178
# Generate the release notes
152
179
sed 's#{version}#${{ env.RELEASE_VERSION }}#g' ${{ github.workspace }}/.github/release_notes.template \
153
180
| sed 's#{sha256_base64}#${{ env.ARCHIVE_SHA256_BASE64 }}#g' \
181
+ | sed 's#{ext_sha256_base64}#${{ env.ARCHIVE_EXT_SHA256_BASE64 }}#g' \
154
182
> ${{ github.workspace }}/.github/release_notes.txt
155
183
- name : Create release
156
184
uses : softprops/action-gh-release@v1
@@ -169,10 +197,20 @@ jobs:
169
197
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
170
198
with :
171
199
upload_url : ${{ steps.rules_rust_release.outputs.upload_url }}
172
- asset_name : rules_rust-v ${{ env.RELEASE_VERSION }}.tar.gz
200
+ asset_name : rules_rust-${{ env.RELEASE_VERSION }}.tar.gz
173
201
asset_path : ${{ github.workspace }}/.github/rules_rust.tar.gz
174
202
asset_content_type : application/gzip
175
203
204
+ - name : " Upload the rules extensions archive"
205
+ uses : actions/upload-release-asset@v1
206
+ env :
207
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
208
+ with :
209
+ upload_url : ${{ steps.rules_rust_release.outputs.upload_url }}
210
+ asset_name : rules_rust_ext-${{ env.RELEASE_VERSION }}.tar.gz
211
+ asset_path : ${{ github.workspace }}/.github/rules_rust_ext.tar.gz
212
+ asset_content_type : application/gzip
213
+
176
214
# There must be a upload action for each platform triple we create
177
215
- name : " Upload aarch64-apple-darwin"
178
216
uses : actions/upload-release-asset@v1
0 commit comments