(fix): try again #59
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 Package | |
on: | |
push: | |
branches: ["main"] | |
paths-ignore: ["!README.md"] | |
jobs: | |
build: | |
name: Build package | |
runs-on: ubuntu-latest | |
outputs: | |
new-version: ${{ steps.bumpVersion.outputs.new-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: npm ci | |
- run: npm run test | |
- run: npm run cleanup | |
- run: npm run build | |
- name: Bump Package Version | |
id: bumpVersion | |
run: | | |
export PACKAGE_VERSION=$(npm run bumpVersion) | |
echo "new-version=$PACKAGE_VERSION" >> "$GITHUB_OUTPUT" | |
- name: Get new Version | |
id: newVersion | |
run: | | |
echo "New version number: ${{ steps.bumpVersion.outputs.new-version }}" | |
releaseNote: | |
needs: build | |
name: Create release notes | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ needs.build.outputs.new-version }} | |
run: | | |
gh release create "$tag" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${tag#v}" \ | |
--generate-notes | |
publish-gpr: | |
needs: releaseNote | |
name: Publish package | |
if: github.repository_owner == 'josh-uvi' #safeguard for forks | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@josh-uvi" | |
- name: start ci | |
run: npm ci | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |