feat: initial commit #1
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: Releases | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "data/**" | |
jobs: | |
changelog: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create new temporary branch | |
run: git branch "release-from-${{ github.sha }}" "${{ github.sha }}" | |
- name: Switch to new branch | |
run: git checkout release-from-${{ github.sha }} | |
- name: Conventional changelog action | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
version-file: "./package.json" | |
git-branch: "release-from-${{ github.sha }}" | |
skip-git-pull: true | |
- name: Create a PR with release info | |
if: steps.changelog.outputs.skipped == 'false' | |
id: create-pr | |
run: gh pr create --base main --head release-from-${{ github.sha }} --title 'Merge new release into main' --body 'Created by Github action' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Merge the PR | |
if: steps.changelog.outputs.skipped == 'false' | |
id: merge-pr | |
run: gh pr merge --admin --merge --subject 'Merge release info' --delete-branch | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release with last commit | |
if: steps.changelog.outputs.skipped == 'false' | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.changelog.outputs.tag }} | |
name: ${{ steps.changelog.outputs.tag }} | |
body: ${{ steps.changelog.outputs.clean_changelog }} |