-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (67 loc) · 2.06 KB
/
release.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Create release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: |
mkdir -p build
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-w -extldflags "-static"' -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o build/orchent-amd64-linux orchent.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -a -ldflags '-w -extldflags "-static"' -o build/orchent-amd64-darwin orchent.go
- name: Prepare packages
run: |
mkdir -p .debpkg/usr/bin
cp build/orchent-amd64-linux .debpkg/usr/bin/orchent
chmod +x .debpkg/usr/bin/orchent
mkdir -p .rpmpkg/usr/bin
cp build/orchent-amd64-linux .rpmpkg/usr/bin/orchent
chmod +x .rpmpkg/usr/bin/orchent
- name: Set rpm version
run: |
rpm_version="${github_ref/-/.}"
echo $rpm_version
echo "REF=$rpm_version" >> $GITHUB_ENV
env:
github_ref: ${{ github.ref }}
- name: Create deb package
uses: jiro4989/build-deb-action@v2
with:
package: orchent
package_root: .debpkg
maintainer: Marica Antonacci <[email protected]>
version: ${{ github.ref }}
arch: 'amd64'
desc: 'orchent cli'
- name: Create rpm package
uses: jiro4989/build-rpm-action@v2
with:
summary: 'orchent cli'
package: orchent
package_root: .rpmpkg
maintainer: Marica Antonacci <[email protected]>
version: ${{ env.REF }}
arch: 'x86_64'
desc: 'orchent cli'
- name: debug
run: |
ls -latr
- name: Release
uses: softprops/action-gh-release@v1
#if: startsWith(github.ref, 'refs/tags/')
with:
body_path: CHANGELOG.md
draft: true
files: |
*.deb
*.rpm
build/orchent-amd64-darwin