-
Notifications
You must be signed in to change notification settings - Fork 56
67 lines (63 loc) · 2.22 KB
/
release-packages.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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release Packages
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.17.3'
- name: Checkout code
uses: actions/checkout@v2
- name: Build Go Binary
run: |
go run build.go build
- name: Install Node/NPM
uses: actions/setup-node@v2
with:
node-version: '14.15.1'
- name: Build Frontend
run: |
npm install
PATH=$(npm bin):$PATH
ng build --prod
- name: Install FPM
run: |
sudo apt-get install ruby ruby-dev rubygems build-essential
sudo gem install --no-document fpm
- name: Build Packages
run: |
go run build.go pkg-all
packaging/get-changelog.sh ${{ steps.branch_name.outputs.SOURCE_TAG }} > ${{ github.workspace }}-CHANGELOG.txt
cat ${{ github.workspace }}-CHANGELOG.txt
VERSION=`echo ${{ steps.branch_name.outputs.SOURCE_TAG }}| sed 's/v//g'`
echo "version=$VERSION" >> $GITHUB_ENV
- name: Upload Releases Asset (RPM/DEB)
id: upload-release-asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
body_path: ${{ github.workspace }}-CHANGELOG.txt
draft: false
prerelease: false
files: |
LICENSE
dist/snmpcollector-${{ env.version }}-1.x86_64.rpm
dist/snmpcollector-${{ env.version }}-1.x86_64.rpm.sha1
dist/snmpcollector_${{ env.version }}_amd64.deb
dist/snmpcollector_${{ env.version }}_amd64.deb.sha1