From ac8a889ddb9e62393b5210771360bd320f1820e6 Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Mon, 13 Apr 2020 17:33:03 -0700 Subject: [PATCH] Add release CI --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ Makefile | 12 ----------- README.md | 6 ++---- 3 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d00c5a1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + # Required for the changelog to work correctly + - name: Unshallow + run: git fetch --prune --unshallow + + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: 1.13.x + + - name: Docker login + env: + DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + run: docker login --username "$DOCKER_LOGIN" --password "$DOCKER_PASSWORD" + + - name: Release + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/Makefile b/Makefile index 90f78e5..4148348 100644 --- a/Makefile +++ b/Makefile @@ -20,18 +20,6 @@ docker: docker build -t mxpv/podsync:unstable . docker push mxpv/podsync:unstable -# -# Run goreleaser to build and upload release binaries -# -V = -.PHONY: release -release: - test -n "$(V)" # Version is required - - git tag --delete v$(V) - git tag v$(V) - goreleaser --rm-dist - git push origin --tags - # # Pull GolangCI-Lint dependency # diff --git a/README.md b/README.md index 9c88f26..da8af73 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,5 @@ $ docker-compose up ## How to make a release -Just run: -``` -$ make release V=2.0.7 -``` +Just push a git tag. CI will do the rest. +