Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Split NPM actions on release creation between those that use the publ…
Browse files Browse the repository at this point in the history
…ic NPM

registry (install) and those that use Wombat Dressing Room (publish).

Configure all workflows to use current LTS versions of NodeJS.
RELNOTES: n/a
PiperOrigin-RevId: 465435441
Change-Id: Icb5adb089b1068c324e9539498c1740f532d92a6
  • Loading branch information
12wrigja authored and copybara-github committed Aug 4, 2022
1 parent 60773f1 commit 5c5323c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/draft-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ jobs:

steps:
- uses: actions/checkout@v2
uses: actions/setup-node@v3
with:
node-version: current
# We need to fetch the full repository in order to write complete
# release notes.
fetch-depth: 0
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/publish-on-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Publish on NPM
on:
release:
types: [ published ]
# Allow this workflow to be manually dispatched from the GitHub Actions UI or CLI
# in order to manually create or retry releases. This should not be necessary most of the time, as
# the 'on: release' trigger above should suffice.
workflow_dispatch:

permissions:
contents: read
Expand All @@ -13,11 +17,23 @@ jobs:
steps:
# This action checks out at the commit of the tagged release.
- uses: actions/checkout@v2
# Install all deps in preparation for creating a release.
# Unlike publishing, this is done using the normal NPM registry
# to download deps.
- uses: actions/setup-node@v3
with:
node-version: current
# TODO: We should check in a lockfile and use npm ci here instead.
- run: npm install

# Re-setup node using Wombat Dressing Room as the registry
# The actual NodeJS binaries and such are cached, so doing this
# twice isn't particularly expensive.
- uses: actions/setup-node@v3
with:
node-version: current
registry-url: https://wombat-dressing-room.appspot.com
# Publish google-closure-library.
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_GOOGLE_CLOSURE_LIBRARY }}
Expand Down

0 comments on commit 5c5323c

Please sign in to comment.