-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 1.39 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Release to DockerHub and GitHub
on:
push:
tags:
- '*'
jobs:
docker:
name: Test and publish Docker image
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --prune --tags --unshallow
- name: Test
run: go test -v ./...
- name: Get version
run: echo "VERSION_NUMBER=$(git describe --tags --always)" >> $GITHUB_ENV
- name: Show version
run: echo "Using version ${{ env.VERSION_NUMBER }}"
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: aoepeople/gitlab-crucible-bridge
tags: ${{ env.VERSION_NUMBER }}
github:
name: Build and publish binaries
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code
uses: actions/checkout@v2
- name: Build binaries
run: ./build.sh
- name: Release
uses: softprops/action-gh-release@v1
with:
files: gitlab-crucible-bridge-*
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}