Release #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
# only on manual trigger | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest | |
# You'd need to create this environment and add the secrets NPM_AUTHTOKEN and REPO_PAT | |
environment: release | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
# Don't save creds in the git config (so it's easier to override later) | |
persist-credentials: false | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
- name: Install dependencies | |
run: cd ux-components && npm install | |
- name: Build and Test | |
run: cd ux-components && npm run build | |
- name: Publish package | |
run: | | |
# Git requires these to be set before committing | |
git config user.email "[email protected]" | |
git config user.name "kcamas15" | |
# 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://[email protected]/microsoft/ace-ux-components" | |
cd ux-components && npm run release -- -y -n $NPM_AUTHTOKEN | |
env: | |
NPM_AUTHTOKEN: ${{ secrets.NPM_AUTHTOKEN }} | |
REPO_PAT: ${{ secrets.REPO_PAT }} |