Release CLI #26
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: Release CLI | |
on: | |
workflow_run: | |
workflows: ["Test AoCTL"] | |
branches: [main] | |
types: | |
- completed | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
- name: Test | |
run: go test ./... -cover | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Create new tag | |
run: | | |
tag=$(echo $(git describe --abbrev=0 --tags) | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.) | |
git tag $tag | |
git push --tags | |
- name: Release with GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} | |
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} |