-
Notifications
You must be signed in to change notification settings - Fork 69
125 lines (108 loc) · 2.98 KB
/
release-weekly-build.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Release and Weekly Build
on:
schedule:
- cron: "0 0 * * SUN"
workflow_dispatch:
inputs:
branch:
description: 'Branch'
required: true
default: 'main'
tag:
description: 'Release Tag'
jobs:
lint:
name: Lint
timeout-minutes: 10
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v1
with:
go-version: 1.22
id: go
- name: Checkout code into the Go module directory
uses: actions/checkout@v2
- name: Check license headers
run: make validate
# - name: Run golangci-lint
# run: make lint
build:
name: Cross compile
timeout-minutes: 10
runs-on: ubuntu-latest
env:
GO111MODULE: "on"
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v1
with:
go-version: 1.22
id: go
- name: Checkout code into the Go module directory
uses: actions/checkout@v2
- name: Unit test
run: make test-unit
- name: Cross compile
run: make TAG_NAME=${{ github.event.inputs.tag }} package-cross
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: hub-tool-packages
path: ./dist/*
test:
name: Native e2e tests
timeout-minutes: 10
runs-on: ${{ matrix.os }}
needs: [build]
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
defaults:
run:
shell: bash
env:
GO111MODULE: "on"
GITHUB_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.22
id: go
- name: Checkout code into the Go module directory
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: dist
- name: Extract platform binary
run: mv dist/hub-tool-packages/* dist/ && make -f builder.Makefile ci-extract
# - name: Run e2e tests
# env:
# E2E_HUB_USERNAME: ${{ secrets.E2E_HUB_USERNAME }}
# E2E_HUB_TOKEN: ${{ secrets.E2E_HUB_TOKEN }}
# run: make TAG_NAME=${{ github.event.inputs.tag }} e2e
release:
name: Do GitHub release
timeout-minutes: 30
runs-on: ubuntu-latest
needs: [lint, build, test]
if: ${{ github.event.inputs.tag != '' }} # don't release if no tag is specified
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: dist
- name: Ship it
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*/*"
prerelease: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.tag }}