-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 1.73 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Starfeed Release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read version
id: get_version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Check if tag exists
id: check_tag
run: |
if git rev-parse "refs/tags/${{ env.VERSION }}" >/dev/null 2>&1; then
echo "Tag ${{ env.VERSION }} already exists"
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.4'
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: go mod tidy
- name: Build binary
run: task build
- name: Run lints
run: task lint
publish_docker_image:
runs-on: ubuntu-latest
name: Build and Publish Docker image
needs: build
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: atomicmeganerd/starfeed
tags: ${{ env.VERSION }},latest
- name: Create Git tag
run: git tag ${{ env.VERSION }} && git push origin ${{ env.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
files: bin/starfeed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}