-
Notifications
You must be signed in to change notification settings - Fork 45
98 lines (96 loc) · 3.18 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
name: Create Linux release
on:
push:
tags:
- 'v*.*.*'
env:
RELEASE_VERSION: ${{ github.ref_name }}
LINUX_BIN_PATH: uffizzi-linux
DARWIN_BIN_PATH: uffizzi-darwin
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: Test and Lint
uses: ./.github/workflows/code-quality.yml
gem-release:
needs:
- code-quality
uses: ./.github/workflows/gem-release.yml
secrets: inherit
make-binary:
needs:
- code-quality
strategy:
matrix:
os: [ubuntu-20.04, macos-12]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: 'Install Linux dependencies'
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt update
sudo apt install -y build-essential squashfs-tools curl gcc make bison
- name: 'Install MacOs dependencies'
if: matrix.os == 'macos-12'
run: |
brew install squashfs
- uses: actions/checkout@v2
- name: 'Set up Ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.3'
- name: 'Create Linux Bin'
if: matrix.os == 'ubuntu-20.04'
run: |
wget https://github.com/pmq20/ruby-packer/releases/download/linux-x64/rubyc
chmod +x ./rubyc
./rubyc --openssl-dir=/etc/ssl ./uffizzi --output=${{ env.LINUX_BIN_PATH }}
- name: 'Create Darwin Bin'
if: matrix.os == 'macos-12'
run: |
export PATH="$(brew --prefix)/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L$(brew --prefix)/opt/openssl@1.1/lib"
export CPPFLAGS="-I$(brew --prefix)/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl@1.1/lib/pkgconfig"
export SSL_CERT_FILE=$(ruby -e "require 'openssl'; puts OpenSSL::X509::DEFAULT_CERT_FILE")
wget https://github.com/pmq20/ruby-packer/releases/download/darwin-x64/rubyc
chmod +x ./rubyc
./rubyc --openssl-dir=/etc/ssl ./uffizzi --output=${{ env.DARWIN_BIN_PATH }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-20.04'
with:
name: ${{ env.LINUX_BIN_PATH }}
path: ${{ env.LINUX_BIN_PATH }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: matrix.os == 'macos-12'
with:
name: ${{ env.DARWIN_BIN_PATH }}
path: ${{ env.DARWIN_BIN_PATH }}
create_release:
runs-on: ubuntu-latest
needs:
- make-binary
steps:
- name: Download Linux Bin
uses: actions/download-artifact@master
with:
name: ${{ env.LINUX_BIN_PATH }}
- name: Download Macos Bin
uses: actions/download-artifact@master
with:
name: ${{ env.DARWIN_BIN_PATH }}
- name: Generate release notes
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE_VERSION }}
name: ${{ env.RELEASE_VERSION }}
files: |
${{ github.workspace }}/${{ env.LINUX_BIN_PATH }}
${{ github.workspace }}/${{ env.DARWIN_BIN_PATH }}
generate_release_notes: true