Merge pull request #69 from vshn/renovate/actions-checkout-4.x #27
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 | |
on: | |
push: | |
tags: | |
- "*" | |
branches: | |
- master | |
jobs: | |
dist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Determine Go version from go.mod | |
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Import GPG signing key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.SIGNING_KEY }} | |
- name: Login to Quay.io | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_IO_USER }} | |
password: ${{ secrets.QUAY_IO_TOKEN }} | |
- name: Build changelog from PRs with labels | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v3 | |
with: | |
configuration: ".github/changelog-configuration.json" | |
# PreReleases still get a changelog, but the next full release gets a diff since the last full release, | |
# combining possible changelogs of all previous PreReleases in between. | |
# PreReleases show a partial changelog since last PreRelease. | |
ignorePreReleases: "${{ !contains(github.ref, '-rc') }}" | |
outputFile: .github/release-notes.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Ensure goreleaser identifies repo as dirty for master builds | |
if: "!startsWith(github.ref, 'refs/tags/v')" | |
run: | |
touch .snapshot | |
- name: Publish releases | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
args: release --auto-snapshot --release-notes .github/release-notes.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload deb | |
uses: actions/upload-artifact@v3 | |
with: | |
name: floaty_linux_amd64.deb | |
path: dist/floaty_linux_amd64.deb | |
- name: Upload rpm | |
uses: actions/upload-artifact@v3 | |
with: | |
name: floaty_linux_amd64.rpm | |
path: dist/floaty_linux_amd64.rpm | |
- name: Upload apk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: floaty_linux_amd64.apk | |
path: dist/floaty_linux_amd64.apk |