2024-01-27 22:58:03 -05:00
|
|
|
name: Bump release version
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches: [rolling]
|
|
|
|
types:
|
|
|
|
- closed
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-01-29 10:51:21 -05:00
|
|
|
pull-requests: write
|
|
|
|
repository-projects: write
|
2024-01-27 22:58:03 -05:00
|
|
|
|
|
|
|
concurrency: production
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-01-28 09:30:32 -05:00
|
|
|
name: bump tag version and release
|
2024-01-27 22:58:03 -05:00
|
|
|
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
|
2024-01-28 09:54:38 -05:00
|
|
|
- name: Bump version and push tag
|
2024-01-28 10:03:20 -05:00
|
|
|
id: version-bump
|
2024-01-28 09:59:23 -05:00
|
|
|
uses: hennejg/github-tag-action@v4.3.1
|
2024-01-28 09:54:38 -05:00
|
|
|
with:
|
2024-01-28 09:55:49 -05:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2024-01-28 10:07:02 -05:00
|
|
|
release_branches: rolling
|
2024-01-29 11:05:40 -05:00
|
|
|
- name: create branch
|
|
|
|
uses: peterjgrainger/action-create-branch@v2.2.0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
branch: update-from-${{ github.sha }}
|
2024-01-29 07:06:15 -05:00
|
|
|
- name: update cargo.toml
|
|
|
|
run: |
|
2024-01-29 07:11:59 -05:00
|
|
|
appversion=$(echo "${{ steps.version-bump.outputs.new_tag }}" | sed 's/[v]//')
|
2024-01-29 07:06:15 -05:00
|
|
|
sed -i -e "s/^version = .*/version = \"$appversion\"/" Cargo.toml
|
2024-01-29 07:58:57 -05:00
|
|
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
2024-01-29 10:36:19 -05:00
|
|
|
# create PR using GitHub CLI
|
2024-01-29 11:05:40 -05:00
|
|
|
- name: create PR with update info
|
2024-01-29 10:36:19 -05:00
|
|
|
id: create-pr
|
2024-01-29 11:05:40 -05:00
|
|
|
run: gh pr create --base rolling --head update-from-${{ github.sha }} --title 'Merge new update into rolling' --body 'Created by Github action'
|
2024-01-29 10:36:19 -05:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# merge PR using GitHub CLI
|
2024-01-29 11:05:40 -05:00
|
|
|
- name: merge PR with update info
|
2024-01-29 10:36:19 -05:00
|
|
|
id: merge-pr
|
2024-01-29 11:05:40 -05:00
|
|
|
run: gh pr merge --admin --merge --subject 'Merge update info' --delete-branch
|
2024-01-29 10:36:19 -05:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2024-01-28 02:13:45 -05:00
|
|
|
- name: Create Release
|
2024-01-28 09:18:02 -05:00
|
|
|
uses: softprops/action-gh-release@v1
|
2024-01-28 02:13:45 -05:00
|
|
|
with:
|
2024-01-28 09:18:02 -05:00
|
|
|
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 }}
|
2024-01-28 02:13:45 -05:00
|
|
|
prerelease: false
|
2024-01-28 09:18:02 -05:00
|
|
|
env:
|
2024-01-28 10:13:57 -05:00
|
|
|
GITHUB_REPOSITORY: ${{ github.repository }}
|