feat: add generation and templates packages (v0.2.0) #2
Workflow file for this run
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: CD | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to release (e.g. v0.2.0)' | |
| required: true | |
| env: | |
| RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }} | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24.4" | |
| - name: Run tests | |
| run: go test ./... | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release view ${{ env.RELEASE_TAG }} --repo ${{ github.repository }} \ | |
| && echo "Release already exists, skipping" \ | |
| || gh release create ${{ env.RELEASE_TAG }} \ | |
| --title "${{ env.RELEASE_TAG }}" \ | |
| --generate-notes \ | |
| --repo ${{ github.repository }} |