Skip to content

Commit

Permalink
Add release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mxpv committed Apr 14, 2020
1 parent d6e8a22 commit ac8a889
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit ac8a889

Please sign in to comment.