Use Env Vars to build and push Docker Images, bump golangci-lint to v1.50.1

This commit is contained in:
Th0masL
2023-01-02 13:50:53 +02:00
parent 8e761bc265
commit 7d18be9d77
3 changed files with 15 additions and 7 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v3
- uses: golangci/golangci-lint-action@v3
with:
version: v1.43.0
version: v1.50.1
- name: Go mod
env:
+9 -1
View File
@@ -31,6 +31,10 @@ jobs:
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]
if: startsWith(github.ref, 'refs/tags/')
@@ -38,13 +42,17 @@ jobs:
version: latest
args: release --rm-dist
env:
DOCKERHUB_USER: ${{ secrets.DOCKER_LOGIN }}
GHCR_USER: ${{ env.GHCR_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish nightly build.
- uses: goreleaser/[email protected]
if: github.event_name == 'schedule'
if: ${{ github.repository_owner == 'mxpv' && github.event_name == 'schedule' }}
with:
version: latest
args: release --rm-dist --nightly
env:
DOCKERHUB_USER: ${{ secrets.DOCKER_LOGIN }}
GHCR_USER: ${{ env.GHCR_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+5 -5
View File
@@ -21,11 +21,11 @@ builds:
dockers:
- image_templates:
- 'mxpv/podsync:{{ .Tag }}'
- 'mxpv/podsync:v{{ .Major }}.{{ .Minor }}'
- 'mxpv/podsync:latest'
- 'ghcr.io/mxpv/podsync:{{ .Tag }}'
- 'ghcr.io/mxpv/podsync:latest'
- "{{ .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: