Rework release

This commit is contained in:
Maksym Pavlenko
2023-05-05 16:40:03 -07:00
parent 5c29072bca
commit 947ac530f0
2 changed files with 33 additions and 33 deletions
+33 -25
View File
@@ -9,37 +9,45 @@ jobs:
publish:
name: Publish
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- name: 📦 Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Env Vars
run: |
echo GHCR_USER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
# Publish a new release from git tag.
- uses: goreleaser/[email protected]
- name: 🚧️ Make release
uses: goreleaser/goreleaser-action@v4
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: latest
args: release --rm-dist
args: release --clean
- name: 🧪 Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: 🔒 Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🏗️ Build container and push
uses: docker/build-push-action@v4
env:
DOCKERHUB_USER: ${{ secrets.DOCKER_LOGIN }}
GHCR_USER: ${{ env.GHCR_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
COMMIT: ${{ github.sha }}
with:
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ github.ref_name }}
-8
View File
@@ -19,14 +19,6 @@ builds:
- arm
- arm64
dockers:
- image_templates:
- "{{ .Env.DOCKERHUB_USER }}/podsync:{{ .Tag }}"
- "{{ .Env.DOCKERHUB_USER }}/podsync:v{{ .Major }}.{{ .Minor }}"
- "{{ .Env.DOCKERHUB_USER }}/podsync:latest"
- "ghcr.io/{{ .Env.GHCR_USER }}/podsync:{{ .Tag }}"
- "ghcr.io/{{ .Env.GHCR_USER }}/podsync:latest"
archives:
- replacements:
darwin: Darwin