-
-
Notifications
You must be signed in to change notification settings - Fork 27
139 lines (115 loc) · 4.29 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Releases
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
if: github.repository_owner == 'onesoft-sudo'
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 21.x
uses: actions/setup-node@v4
with:
node-version: 21.x
- name: Install Programs, Libraries and Tools (Linux)
run: |
sudo apt update;
sudo apt install build-essential libcurl4 libcurl4-gnutls-dev -y;
if: matrix.os == 'ubuntu-latest'
- name: Install Programs, Libraries and Tools (macOS)
run: brew install curl pkg-config cairo pango libpng jpeg giflib librsvg
if: matrix.os == 'macos-latest'
- name: "Install Native Libraries"
run: |
git clone https://github.com/Cogmasters/concord;
cd concord;
make;
sudo make install;
cd ..;
- name: "Build Native Libraries with GNU Make"
run: make
- name: "Build with BlazeBuild"
run: ./blazew build
- name: "Package the build output files"
run: |
OS="${{ matrix.os }}";
mkdir sudobot-release-${OS};
mv build sudobot-release-${OS};
mv src sudobot-release-${OS};
mkdir sudobot-release-${OS}/lib;
mv lib/build sudobot-release-${OS}/lib/build;
tar -cvzf sudobot-release-${OS}-incomplete.tar.gz sudobot-release-${OS};
- name: Upload Release Artifacts
uses: actions/upload-artifact@v4
with:
name: sudobot-release-${{ matrix.os }}-incomplete
path: |
./sudobot-release-${{ matrix.os }}-incomplete.tar.gz
release:
needs: [build]
if: github.repository_owner == 'onesoft-sudo'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare Git
run: |
echo "${{ secrets.COMMIT_GPG_KEY }}" > private.key
gpg --import private.key
rm -f private.key
git config --global user.signingkey "6AE7B08C68169452"
git config --global commit.gpgsign true
- name: Conventional Release Action
id: auto_release
uses: onesoft-sudo/conventional-release-action@main
with:
version-json-file: "./package.json"
git-user-name: "Conventional Release Action"
git-user-email: rakinar2@onesoftnet.eu.org
commit-message-format: "release: v%s [skip ci]"
git-sign-off: true
changelog-file: CHANGELOG.md
changelog-format: markdown
allowed-commit-types: feat,fix,refactor,perf,ci,build,test,revert,chore,release,deps
- name: Download Linux Release Artifact
uses: actions/download-artifact@v4
with:
name: sudobot-release-ubuntu-latest-incomplete
- name: Download macOS Release Artifact
uses: actions/download-artifact@v4
with:
name: sudobot-release-macos-latest-incomplete
- name: Extract Artifacts
run: |
tar -xvzf sudobot-release-ubuntu-latest-incomplete.tar.gz;
tar -xvzf sudobot-release-macos-latest-incomplete.tar.gz;
- name: Rename Artifacts
run: |
mv sudobot-release-ubuntu-latest sudobot-release-linux;
mv sudobot-release-macos-latest sudobot-release-darwin;
- name: Add package.json to Incomplete Artifacts
run: |
cp package.json sudobot-release-linux/package.json;
cp package.json sudobot-release-darwin/package.json;
- name: Re-package Artifacts
run: |
tar -cvzf sudobot-release-linux.tar.gz sudobot-release-linux;
tar -cvzf sudobot-release-darwin.tar.gz sudobot-release-darwin;
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
if: ${{ steps.auto_release.outputs.tag != '' }}
env:
GITHUB_TOKEN: ${{ secrets.__TOKEN }}
with:
tag: ${{ steps.auto_release.outputs.tag }}
name: ${{ steps.auto_release.outputs.tag }}
body: ${{ steps.auto_release.outputs.release_notes }}
artifactContentType: application/x-gzip
artifacts: ./sudobot-release-linux.tar.gz,./sudobot-release-darwin.tar.gz