@@ -128,29 +128,57 @@ jobs:
128128 - name : Create the rules archive
129129 run : |
130130 # 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+
132134 bazel clean
135+
133136 # Build an archive of the repo contents.
134137 # `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+
136147 # Save the sha256 checksum of the distro archive to the environment
137148 sha256_base64="$(shasum --algorithm 256 ${{ github.workspace }}/.github/rules_rust.tar.gz | awk '{ print $1 }' | xxd -r -p | base64)"
138149 echo "ARCHIVE_SHA256_BASE64=${sha256_base64}" >> $GITHUB_ENV
139150 env :
140151 CARGO_BAZEL_GENERATOR_URL : file://${{ github.workspace }}/crate_universe/target/artifacts/x86_64-unknown-linux-gnu/cargo-bazel
141152 ARTIFACTS_DIR : ${{ github.workspace }}/crate_universe/target/artifacts
142153 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
143165 # Upload the artifact in case creating a release fails so all artifacts can then be manually recovered.
144166 - uses : actions/upload-artifact@v3
145167 with :
146168 name : " rules_rust.tar.gz"
147169 path : ${{ github.workspace }}/.github/rules_rust.tar.gz
148170 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
149176 - name : Generate release notes
150177 run : |
151178 # Generate the release notes
152179 sed 's#{version}#${{ env.RELEASE_VERSION }}#g' ${{ github.workspace }}/.github/release_notes.template \
153180 | sed 's#{sha256_base64}#${{ env.ARCHIVE_SHA256_BASE64 }}#g' \
181+ | sed 's#{ext_sha256_base64}#${{ env.ARCHIVE_EXT_SHA256_BASE64 }}#g' \
154182 > ${{ github.workspace }}/.github/release_notes.txt
155183 - name : Create release
156184 uses : softprops/action-gh-release@v1
@@ -169,10 +197,20 @@ jobs:
169197 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
170198 with :
171199 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
173201 asset_path : ${{ github.workspace }}/.github/rules_rust.tar.gz
174202 asset_content_type : application/gzip
175203
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+
176214 # There must be a upload action for each platform triple we create
177215 - name : " Upload aarch64-apple-darwin"
178216 uses : actions/upload-release-asset@v1
0 commit comments