Skip to content

Commit

Permalink
Tweak GitHub actions for internal repo. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe committed Aug 15, 2022
1 parent cbc957e commit 2edaa6a
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ jobs:
- "ubuntu-latest"
node:
- "18"
- "16"
- "14"
- "12"
- "10"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -89,33 +85,3 @@ jobs:

- name: Test
run: yarn && yarn test

publish:
name: Publish
if: >-
(github.event_name == 'workflow_dispatch' || github.event_name == 'push') &&
startsWith(github.ref, 'refs/tags/v') &&
endsWith(github.actor, '-stripe')
needs: [build, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install -y oathtool
- name: Publish to NPM
run: |
set +ex
npm config set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN
# print the NPM user name for validation
npm whoami
VERSION=$(npm -s run env echo '$npm_package_version')
# Only publish stable versions to the latest tag
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
NPM_TAG="latest"
else
NPM_TAG="beta"
fi
echo "Publishing $VERSION with $NPM_TAG tag."
npm publish --otp="$(oathtool -b --totp $NPM_OTP)" --tag $NPM_TAG
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_OTP: ${{ secrets.NPM_OTP }}

0 comments on commit 2edaa6a

Please sign in to comment.