Skip to content

gh release create

gh release create #200

name: gh release create
on:
push:
branches: "main"
paths-ignore:
- README.md
- LICENSE
- .gitignore
- .github/**
- "!.github/workflows/gh-release-create.yml"
schedule:
- cron: "41 */6 * * *"
workflow_dispatch:
concurrency: ${{ github.workflow }}
jobs:
npm-test:
uses: ./.github/workflows/npm-test.yml
gh-release-create:
needs: npm-test
permissions:
contents: write
outputs:
new-version: ${{ steps.xversion.outputs.new-version }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: npm
- run: npm ci
- id: xversion
run: npm run xversion
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: steps.xversion.outputs.new-version
uses: actions4git/add-commit-push@v1
- if: steps.xversion.outputs.new-version
run: gh release create "v$NEW_VERSION" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_VERSION: ${{ steps.xversion.outputs.new-version }}
npm-publish:
needs: gh-release-create
if: needs.gh-release-create.outputs.new-version
uses: ./.github/workflows/npm-publish.yml
secrets: inherit