cli: more ci/cd bugs, i need a devops engineer lol #14
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: Release CLI | |
| on: | |
| push: | |
| tags: | |
| - "cli/v*" | |
| jobs: | |
| release: | |
| runs-on: proxmox-lxc | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Set version | |
| id: version | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#cli/} | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Extract changelog | |
| id: changelog | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#cli/} | |
| CHANGES=$(awk -v ver="$VERSION" ' | |
| $0 ~ "^## \\[" ver "\\]" {found=1; next} | |
| $0 ~ "^## \\[" {found=0} | |
| found {print} | |
| ' cli/CHANGELOG.md) | |
| if [ -z "$CHANGES" ]; then | |
| CHANGES="No changelog entry was found for this release." | |
| fi | |
| echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGES" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - uses: goreleaser/goreleaser-action@v5 | |
| with: | |
| version: latest | |
| args: release --clean cli/.goreleaser.yaml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GORELEASER_NOTES: ${{ steps.changelog.outputs.changelog }} | |
| GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.version }} |