From 975929fc85c3af766d73246fe66fffb2f0660eb6 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Sun, 12 Feb 2023 21:15:56 -0800 Subject: [PATCH] Updates CI to publish `@aspect_rules_js` versions of the NPM packages. Refs #48. --- .github/workflows/publish.yaml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index b2754212..99b4887e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -53,7 +53,8 @@ jobs: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" >> .npmrc # Publish the package. - bazel run //:pkg.publish --config ci --config release + bazel run --config ci --config release //:rules_prerender_pkg_publish + bazel run --config ci --config release //packages/rules_prerender/declarative_shadow_dom:pkg_publish # Remove the token from the `.npmrc` file, it should no longer be needed. sed -i "/${{ secrets.NPM_ACCESS_TOKEN }}/d" .npmrc @@ -70,15 +71,18 @@ jobs: tag_name: releases/${{ github.event.inputs.version }} release_name: ${{ github.event.inputs.version }} prerelease: ${{ github.event.inputs.prerelease == 'true' }} - body: https://www.npmjs.com/package/rules_prerender/v/${{ github.event.inputs.version }} draft: true # Compress the built NPM package into a `.tar.gz` file. - - name: Tar Package - run: tar -czf rules_prerender-${{ github.event.inputs.version }}.tar.gz dist/bin/pkg/ + - name: Tar Packages + run: | + tar -czf rules_prerender-${{ github.event.inputs.version }}.tar.gz \ + dist/bin/rules_prerender_pkg/ + tar -czf rules_prerender-declarative_shadow_dom-${{ github.event.inputs.version }}.tar.gz \ + dist/bin/packages/rules_prerender/declarative_shadow_dom/pkg/ - # Upload the NPM package to the GitHub release. - - name: Upload Package to GitHub + # Upload `rules_prerender` to the GitHub release. + - name: Upload `rules_prerender` to GitHub uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -88,6 +92,17 @@ jobs: asset_name: rules_prerender-${{ github.event.inputs.version }}.tar.gz asset_content_type: application/gzip + # Upload `@rules_prerender/declarative_shadow_dom` to the GitHub release. + - name: Upload `@rules_prerender/declarative_shadow_dom` to GitHub + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: rules_prerender-declarative_shadow_dom-${{ github.event.inputs.version }}.tar.gz + asset_name: rules_prerender-declarative_shadow_dom-${{ github.event.inputs.version }}.tar.gz + asset_content_type: application/gzip + # Notify the user that the release is completed. - name: Complete run: |