-
Notifications
You must be signed in to change notification settings - Fork 23
93 lines (74 loc) · 2.45 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
name: Create draft release
on:
pull_request:
branches:
- main
types:
- closed
workflow_dispatch:
jobs:
build-linux:
if: ${{ github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: install linux deps
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: dia libbtrfs-dev libgpgme-dev
version: 1.0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build artifact amd64
run: go build -o gmd_linux_amd64 .
- name: Store version info
run: echo "version=v$(./gmd_linux_amd64 -v | cut --delimiter ' ' --fields 3)" >> $GITHUB_ENV
- name: Tar artifact
run: tar czf gomanagedocker_linux_amd64_${version}.tar.gz gmd_linux_amd64
- name: Upload linux assets
uses: actions/upload-artifact@v4
with:
name: linux_artifacts
path: gomanagedocker_linux*.tar.gz
build-darwin:
if: ${{ github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' }}
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: install mac os deps
run: brew install gpgme
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build artifact amd64
run: go build -o gmd_darwin_amd64 .
- name: Build artifact arm64
run: env GOOS=darwin GOARCH=amd64 go build -o gmd_darwin_arm64 .
- name: Store version info
run: echo "version=v$(./gmd_darwin_amd64 -v | cut -d ' ' -f 3)" >> $GITHUB_ENV
- name: Tar artifact
run: |
tar czf gomanagedocker_darwin_amd64_${version}.tar.gz gmd_darwin_amd64
tar czf gomanagedocker_darwin_arm64_${version}.tar.gz gmd_darwin_arm64
- name: Upload darwin assets
uses: actions/upload-artifact@v4
with:
name: macos_artifacts
path: gomanagedocker_darwin*.tar.gz
create-release:
if: ${{ github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
needs: [build-linux, build-darwin]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
linux_artifacts/*
macos_artifacts/*