2020-05-26 00:21:22 +03:00
|
|
|
name: Release
|
|
|
|
|
2024-01-10 08:53:01 +03:00
|
|
|
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
# NOTE: Because this package is inactive, the npm and github token secrets have been removed.
|
|
|
|
# Before running this workflow, you must generate a new granular npm token and github token,
|
|
|
|
# go to Settings => Environments => release, and add the secrets REPO_PAT and NPM_AUTHTOKEN.
|
2024-11-21 05:18:12 +03:00
|
|
|
# You'll also need to update the ruleset for main to allow a bypass.
|
2024-01-10 08:53:01 +03:00
|
|
|
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2020-05-26 00:21:22 +03:00
|
|
|
on:
|
2024-01-10 08:53:01 +03:00
|
|
|
workflow_dispatch:
|
|
|
|
# push:
|
2024-11-21 05:18:12 +03:00
|
|
|
# branches: [main]
|
2020-05-26 00:21:22 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-02-21 23:28:12 +03:00
|
|
|
# This environment contains secrets needed for publishing
|
|
|
|
environment: release
|
|
|
|
|
2020-05-26 00:21:22 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [12.x]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2020-10-19 23:47:38 +03:00
|
|
|
fetch-depth: 0
|
2023-02-21 23:28:12 +03:00
|
|
|
# Don't save creds in the git config (so it's easier to override later)
|
|
|
|
persist-credentials: false
|
|
|
|
|
2020-05-26 00:21:22 +03:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2023-02-21 23:28:12 +03:00
|
|
|
|
2020-05-26 00:21:22 +03:00
|
|
|
- run: yarn
|
2023-02-21 23:28:12 +03:00
|
|
|
|
2020-05-26 00:21:22 +03:00
|
|
|
- run: yarn build
|
2023-02-21 23:28:12 +03:00
|
|
|
|
|
|
|
- name: Publish package
|
|
|
|
run: |
|
2020-05-26 00:21:22 +03:00
|
|
|
git config user.email "kchau@microsoft.com"
|
|
|
|
git config user.name "Ken Chau"
|
2023-02-21 23:28:12 +03:00
|
|
|
|
|
|
|
# Get the existing remote URL without creds, and use a trap (like try/finally)
|
|
|
|
# to restore it after this step finishes
|
|
|
|
trap "git remote set-url origin '$(git remote get-url origin)'" EXIT
|
|
|
|
|
|
|
|
# Add a token to the remote URL for auth during release
|
|
|
|
git remote set-url origin "https://$REPO_PAT@github.com/$GITHUB_REPOSITORY"
|
|
|
|
|
|
|
|
yarn release -y -n "$NPM_AUTHTOKEN"
|
2020-05-26 00:21:22 +03:00
|
|
|
env:
|
2023-02-21 23:28:12 +03:00
|
|
|
NPM_AUTHTOKEN: ${{ secrets.NPM_AUTHTOKEN }}
|
|
|
|
REPO_PAT: ${{ secrets.REPO_PAT }}
|