ci(release): update GitHub Actions and jreleaser configuration #13
This file contains hidden or 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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main ] | |
| # tags: | |
| # - 'v*' | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build and Release | |
| # if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| - name: Extract version | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV | |
| - name: Jreleaser Assemble | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| arguments: assemble | |
| env: | |
| JRELEASER_PROJECT_VERSION: ${{ env.VERSION }} | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: JReleaser assemble output | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 1 | |
| name: jreleaser-assemble | |
| path: | | |
| out/jreleaser/trace.log | |
| out/jreleaser/output.properties | |
| - name: Jreleaser Release | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| arguments: release | |
| env: | |
| JRELEASER_PROJECT_VERSION: ${{ env.VERSION }} | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: JReleaser release output | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| retention-days: 1 | |
| name: jreleaser-release | |
| path: | | |
| out/jreleaser/trace.log | |
| out/jreleaser/output.properties |