-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (102 loc) · 2.95 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
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
name: Build
on:
push:
#branches: [ master ]
tags: [ 'v*' ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
codename: [focal]
steps:
- uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Build debian package
uses: sigmonsays/dpkg-buildpackage-go@master
- name: list files
run: ls -l *.deb
- name: Upload result
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.codename }}
path: |
*.deb
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: ${{ matrix.codename }}
path: artifact
release:
needs: test
runs-on: ubuntu-latest
steps:
- name: Create release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
commitish: ${{ github.sha }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
codename: [focal]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: ${{ matrix.codename }}
path: ${{ matrix.codename }}
- name: list files
shell: bash
run: find
- name: Get Name of Artifact
run: |
ARTIFACT_PATHNAME=$(ls ${{ matrix.codename }}/*.deb | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
- name: Upload release asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
# asset_path: ${{ matrix.codename }}
# asset_name: ${{ matrix.codename }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/deb
release-binaries:
name: release linux/amd64
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64]
steps:
- uses: actions/checkout@v2
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
#project_path: .
binary_name: dotbot
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
#goversion: "https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz"