release everything #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: release-got-api | |
on: | |
push: | |
tags: | |
- 'packages/got-api/v*.*.*' | |
- '!v*.*.*-**' | |
env: | |
# THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET | |
# AND PUBLISH_NPM: TRUE. IF YOU WANT TO PUBLISH TO A PRIVATE NPM REGISTRY | |
# THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED | |
# NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} | |
NPM_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} | |
PUBLISH_NPM: true | |
NPM_REGISTRY_URL: https://registry.npmjs.org | |
jobs: | |
publish: | |
name: Publish SDKs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Unshallow clone for tags | |
run: git fetch --tags --force | |
- name: Check worktree clean | |
working-directory: ./packages/got-api | |
run: | | |
git update-index -q --refresh | |
if ! git diff-files --quiet; then | |
>&2 echo "error: working tree is not clean, aborting!" | |
git status | |
git diff | |
exit 1 | |
fi | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: ${{env.NPM_REGISTRY_URL}} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
# - name: Set version to release tag | |
# working-directory: ./packages/got-api | |
# shell: bash | |
# run: pnpm version from-git --no-commit-hooks --no-git-tag-version --allow-same-version | |
- name: Install | |
shell: bash | |
run: pnpm install | |
- name: Build Api | |
working-directory: ./packages/got-api | |
shell: bash | |
run: pnpm build | |
- name: Publish | |
working-directory: ./packages/got-api | |
shell: bash | |
run: pnpm publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }} | |
# - name: Push version changes to main branch | |
# uses: stefanzweifel/git-auto-commit-action@v5 | |
# with: | |
# commit_message: 'chore: release ${{ github.event.release.tag_name }}' | |
# branch: ${{ github.event.repository.default_branch }} | |
# file_pattern: packages/got-api/package.json | |
strategy: | |
fail-fast: true |