Skip to content

goreleaser

goreleaser #25

Workflow file for this run

name: goreleaser
on:
create:
tags:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Ensure tag match the current version
run: |
if [ "v$(grep '// ci-version-check' cmd/version.go | sed -r 's/.+return\s"(.+)".+/\1/')" != "$(git tag | sort --version-sort | tail -1)" ] ; then
echo "Tag version do not match application version"
exit 1
fi
- name: Set up Go
uses: actions/setup-go@main
with:
go-version: 1.22.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare AUR package
run: |
version=$(awk -F'"' '/ci-version-check/{print $2}' cmd/version.go)
md5version=$(curl -sL https://github.com/Qovery/helm-freeze/archive/v${version}.tar.gz --output - | md5sum | awk '{ print $1 }')
sed -i "s/pkgver=tbd/pkgver=$version/" PKGBUILD
echo "md5sums=('${md5version}')" >> PKGBUILD
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
pkgname: helm-freeze
pkgbuild: ./PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
force_push: "true"