85 lines
2.9 KiB
YAML
85 lines
2.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
# run only against tags
|
|
tags:
|
|
- '*'
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
# issues: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
|
DOCKER_REGISTRY: "ghcr.io"
|
|
DOCKER_IMAGE_NAME: "unpoller/unpoller"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- run: git fetch --force --tags
|
|
- name: Install RPM tooling
|
|
run: sudo apt-get install -y rpm
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3.1.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3.1.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Import GPG key
|
|
id: import_gpg
|
|
uses: crazy-max/ghaction-import-gpg@v6
|
|
with:
|
|
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
|
|
- name: "Setup Ruby for packagecloud uploads"
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '2.7'
|
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
- name: "Install packagecloud gem"
|
|
run: gem install package_cloud
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 'stable'
|
|
cache: true
|
|
# More assembly might be required: Docker logins, GPG, etc. It all depends
|
|
# on your needs.
|
|
- name: "make key file"
|
|
run: "echo '${{ secrets.GPG_SIGNING_KEY }}' > /tmp/key.gpg"
|
|
- uses: goreleaser/goreleaser-action@v5
|
|
with:
|
|
# either 'goreleaser' (default) or 'goreleaser-pro':
|
|
distribution: goreleaser-pro
|
|
version: latest
|
|
args: release --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
|
|
# distribution:
|
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
|
# This needs to be reset every year (next one at 2023-12-22) - use a fine grained PAT with Contents: R/W on golift/homebrew-mugs.
|
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|
|
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
|
|
GPG_SIGNING_KEY: /tmp/key.gpg
|
|
GPG_SIGNING_KEY_ID: ${{ steps.import_gpg.outputs.keyid }}
|
|
- name: Update Docker Hub Description
|
|
uses: peter-evans/dockerhub-description@v4
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
repository: golift/unifi-poller |