Skip to content

Commit

Permalink
ci: automate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Aug 14, 2024
1 parent 068ed01 commit b957264
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
with:
go-version: stable

- uses: go-semantic-release/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: ko-build/setup-ko@v0.6

- name: Log in to GHCR
Expand All @@ -30,6 +34,16 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- run: |
ko build --sbom=none --bare .
git fetch --tags
descr=$(git describe --tags)
short=$(git describe --tags --abbrev=0)
export version="${descr#v}"
if [[ $descr == $short ]]; then
minor="${version#*.}"
major="${version%%.*}"
ko build --bare --sbom=none -t edge -t latest -t "$version" -t "$minor" -t "$major" .
else
ko build --bare --sbom=none -t edge .
fi
env:
KO_DOCKER_REPO: ghcr.io/${{ github.repository }}

0 comments on commit b957264

Please # to comment.