-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (80 loc) · 2.38 KB
/
ci.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
on:
push:
branches: [ "main" ]
tags:
- 'v*.*.*'
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
cache: true
- name: Test
run: |
export TEST_DEBUG=1
export TEST_EXTRA_TAGS=" "
bash ./scripts/run_tests.sh
- name: Coverage Badge - Generate
if: github.event_name != 'pull_request'
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage-percent.out
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v12
id: verify-changed-files
with:
files: README.md
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "chore: Update README.md"
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
services:
mail_server:
image: ghcr.io/deltachat/mail-server-tester:release
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993
release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- id: check-tag
run: |
if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi
- uses: actions/setup-go@v3
if: ${{ github.event_name == 'push' && steps.check-tag.outputs.match == 'true' }}
with:
go-version: '1.21'
cache: true
- uses: goreleaser/goreleaser-action@v4
if: ${{ github.event_name == 'push' && steps.check-tag.outputs.match == 'true' }}
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}