2023-08-14 19:26:48 -04:00
|
|
|
---
|
2023-08-14 18:46:16 -04:00
|
|
|
name: Release
|
|
|
|
|
2023-08-14 19:26:48 -04:00
|
|
|
# yamllint disable-line rule:truthy
|
2023-08-14 18:46:16 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "*"
|
|
|
|
|
|
|
|
jobs:
|
2023-08-14 19:26:48 -04:00
|
|
|
goreleaser:
|
2023-08-14 18:46:16 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version-file: go.mod
|
2023-08-14 19:31:34 -04:00
|
|
|
- uses: https://github.com/goreleaser/goreleaser-action@v2
|
2023-08-14 18:46:16 -04:00
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --snapshot --clean
|
|
|
|
env:
|
|
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
2023-08-14 19:26:48 -04:00
|
|
|
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v4
|
|
|
|
with:
|
|
|
|
# list of Docker images to use as base name for tags
|
|
|
|
images: git.fifitido.net/apps/ytdl-web
|
|
|
|
# generate Docker tags based on the following events/attributes
|
|
|
|
tags: |
|
2023-08-14 19:41:05 -04:00
|
|
|
type=semver,pattern={{version}}
|
2023-08-14 19:26:48 -04:00
|
|
|
type=sha
|
|
|
|
- name: Setup QEMU
|
2023-08-14 19:31:34 -04:00
|
|
|
uses: https://github.com/docker/setup-qemu-action@v2
|
2023-08-14 19:26:48 -04:00
|
|
|
- name: Setup Docker Buildx
|
2023-08-14 19:31:34 -04:00
|
|
|
uses: https://github.com/docker/setup-buildx-action@v2
|
2023-08-14 19:26:48 -04:00
|
|
|
- name: Login to Docker Registry
|
2023-08-14 19:31:34 -04:00
|
|
|
uses: https://github.com/docker/login-action@v2
|
2023-08-14 19:26:48 -04:00
|
|
|
with:
|
|
|
|
registry: git.fifitido.net
|
|
|
|
username: ${{ gitea.repository_owner }}
|
|
|
|
password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Build and push
|
2023-08-14 19:31:34 -04:00
|
|
|
uses: https://github.com/docker/build-push-action@v4
|
2023-08-14 19:26:48 -04:00
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
# yamllint disable rule:line-length
|
|
|
|
build-args: |
|
|
|
|
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
|
|
|
BUILD=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
|
|
|
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
|
|
|
BUILT_BY=Gitea Actions
|
|
|
|
# yamllint enable rule:line-length
|