Skip to content

chore: refactor resources query #82

chore: refactor resources query

chore: refactor resources query #82

name: release_workflow
on:
pull_request:
types:
- closed
jobs:
release_workflow:
if: ${{ github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/') }}
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
submodules: true
- uses: actions/setup-go@v3
with:
go-version: '1.18'
- run: make install_tools
- name: Extract version from branch name
id: version
run: |
BRANCH_NAME=${{ github.event.pull_request.head.ref }}
VERSION=v${BRANCH_NAME#release/}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Ensure changelog exists
run: ls changes/${{ steps.version.outputs.VERSION }}.md
- name: Generate extra files
run: make release_extra_files
- name: Tag version
run: |
VERSION=${{ steps.version.outputs.VERSION }}
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git tag -a -F changes/$VERSION.md $VERSION
git push origin $VERSION
- name: Run goreleaser
run: |
goreleaser release \
--release-notes=changes/${{ steps.version.outputs.VERSION }}.md \
--skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}