v2.19.0-beta.0 #11
Workflow file for this run
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: Prerelease | |
on: | |
release: | |
types: | |
- prereleased | |
permissions: {} | |
jobs: | |
release: | |
name: Version & Publish | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
registry-url: 'https://registry.npmjs.org' | |
- name: Set up pnpm | |
run: corepack enable pnpm | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Create Beta Branch | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git checkout -b beta | |
git push --force origin beta --set-upstream | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Version Package | |
run: npm version ${{ github.event.release.tag_name }} --git-tag-version=false | |
- name: Push package.json and tags | |
run: | | |
sha=$(gh api --method PUT /repos/:owner/:repo/contents/$FILE_TO_COMMIT \ | |
-f message="Release ${{ github.event.release.tag_name }}" \ | |
-f content="$( base64 -i $FILE_TO_COMMIT )" \ | |
-f encoding="base64" \ | |
-f branch="$DESTINATION_BRANCH" \ | |
-f sha="$( git rev-parse $DESTINATION_BRANCH:$FILE_TO_COMMIT )" --jq '.commit.sha') | |
gh api --method PATCH /repos/:owner/:repo/git/refs/tags/${{ github.event.release.tag_name }} \ | |
-f sha="$sha" -F force=true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FILE_TO_COMMIT: package.json | |
DESTINATION_BRANCH: beta | |
- name: Publish to npm | |
run: pnpm build && npm publish --provenance --tag beta | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |