0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-11-26 07:58:20 -05:00
websurfx/.github/workflows/release.yml

59 lines
1.9 KiB
YAML
Raw Normal View History

name: Bump release version
on:
pull_request:
branches: [rolling]
types:
- closed
permissions:
contents: write
concurrency: production
jobs:
build:
2024-01-28 09:30:32 -05:00
name: bump tag version and release
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
2024-01-28 09:30:32 -05:00
uses: actions/checkout@v3
with:
2024-01-28 10:46:42 -05:00
ref: ${{ github.sha }}
2024-01-28 09:30:32 -05:00
fetch-depth: 0
- name: Bump version and push tag
id: version-bump
2024-01-28 09:59:23 -05:00
uses: hennejg/github-tag-action@v4.3.1
with:
2024-01-28 09:55:49 -05:00
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: rolling
- name: update cargo.toml
run: |
appversion=$(echo "${{ steps.version-bump.outputs.new_tag }}" | sed 's/[v]//')
sed -i -e "s/^version = .*/version = \"$appversion\"/" Cargo.toml
2024-01-29 07:58:57 -05:00
- uses: stefanzweifel/git-auto-commit-action@v5
# create PR using GitHub CLI
- name: create 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 }}
# merge PR using GitHub CLI
- name: merge PR with release info
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
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
name: ${{ steps.version-bump.outputs.new_tag }}
2024-01-28 02:27:59 -05:00
tag_name: ${{ steps.version-bump.outputs.new_tag }}
prerelease: false
env:
GITHUB_REPOSITORY: ${{ github.repository }}