From f337f6c8b16acad6f6a86648f72061e098652040 Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Fri, 31 Dec 2021 15:16:31 +0200 Subject: [PATCH] Update release actions Signed-off-by: Maksym Pavlenko --- .github/workflows/release.yml | 22 +++++++++++++--------- .goreleaser.yml | 7 +++---- Dockerfile | 11 ++++------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 179859b3..80f7164f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,22 +13,26 @@ jobs: steps: - uses: actions/checkout@v2.4.0 - - # Required for the changelog to work correctly - - run: git fetch --prune --unshallow + with: + fetch-depth: 0 - uses: actions/setup-go@v2.1.5 + + - uses: docker/login-action@v1 with: - go-version: 1.15 + username: ${{ secrets.DOCKER_LOGIN }} + password: ${{ secrets.DOCKER_PASSWORD }} - - env: - DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: docker login --username "$DOCKER_LOGIN" --password "$DOCKER_PASSWORD" + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - uses: goreleaser/goreleaser-action@v2.8.0 + if: startsWith(github.ref, 'refs/tags/') with: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 44f81048..93a8b0e3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,9 +24,8 @@ dockers: - 'mxpv/podsync:{{ .Tag }}' - 'mxpv/podsync:v{{ .Major }}.{{ .Minor }}' - 'mxpv/podsync:latest' - binaries: - - podsync - dockerfile: Dockerfile + - 'ghcr.io/mxpv/podsync:{{ .Tag }}' + - 'ghcr.io/mxpv/podsync:latest' archives: - replacements: @@ -43,7 +42,7 @@ checksum: name_template: 'checksums.txt' snapshot: - name_template: "{{ .Tag }}-next" + name_template: '{{ .Tag }}-next' changelog: sort: asc diff --git a/Dockerfile b/Dockerfile index fcd403e0..358f0e37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,11 @@ -FROM golang:1.17.5-alpine3.15 AS builder -WORKDIR /app -COPY . /app/ -RUN go build -o podsync ./cmd/podsync +# This is a template to be used by GoReleaser. +# See docs for details: https://goreleaser.com/customization/docker/ FROM alpine:3.10 -WORKDIR /app/ RUN wget -O /usr/bin/youtube-dl https://github.com/ytdl-org/youtube-dl/releases/latest/download/youtube-dl && \ chmod +x /usr/bin/youtube-dl && \ apk --no-cache add ca-certificates python ffmpeg tzdata -COPY --from=builder /app/podsync /app/podsync +COPY podsync /podsync -ENTRYPOINT ["/app/podsync"] +ENTRYPOINT ["/podsync"] CMD ["--no-banner"]