forked from jenkins-zh/jenkins-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (60 loc) · 1.65 KB
/
backup.yaml
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
name: Backup Git repository
on:
workflow_dispatch:
push:
branches:
- master
jobs:
BackupBinary:
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v3.2.1
with:
go-version: 1.16
id: go
- uses: actions/checkout@v3.0.2
- name: Upgrade upx
run: |
# try to fix https://github.com/jenkins-zh/jenkins-cli/issues/493
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
tar xvf upx-3.96-amd64_linux.tar.xz
upx-3.96-amd64_linux/upx -V
sudo mv upx-3.96-amd64_linux/upx $(which upx)
upx -V
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.7.0
with:
version: latest
args: release --rm-dist --snapshot
BackupGit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
- name: backup
uses: jenkins-zh/git-backup-actions@v0.0.6
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
TARGET_GIT: "git@gitee.com:jenkins-zh/jenkins-cli.git"
UnitTest:
name: Test
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v3.2.1
with:
go-version: 1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3.0.2
- name: Test
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.0.3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.out
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true