Build and Release #5
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: Build and Release | |
run-name: Build and Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-job: | |
name: Build panzer-plugin | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go version | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Install versioning tool | |
run: go install github.com/xchapter7x/versioning@latest | |
- name: Determine Version | |
id: determine_version | |
run: | | |
echo VERSION=$(~/go/bin/versioning bump_patch) >> ${GITHUB_ENV} | |
- name: Build panzer-plugin | |
env: | |
COMMIT: ${{ github.sha }} | |
run: .github/scripts/build.sh | |
- name: upload panzer-plugin | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
release_job: | |
name: Release panzer-plugin | |
runs-on: ubuntu-latest | |
needs: build-job | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install versioning tool | |
run: go install github.com/xchapter7x/versioning@latest | |
- name: Determine Version | |
id: determine_version | |
run: | | |
echo VERSION=$(~/go/bin/versioning bump_patch) >> ${GITHUB_ENV} | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Create Release using gh | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: "Release ${{ env.VERSION }}" | |
files: dist/* | |
tag_name: ${{ env.VERSION }} |