-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (172 loc) · 6.46 KB
/
server.yml
File metadata and controls
173 lines (172 loc) · 6.46 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Build, Upload and Release Binaries
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
aur-build:
name: Build Binary for AUR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install UPX
run: sudo apt update && sudo apt install -y upx
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.6
- name: Build (AUR Only)
run: cd licensing/ && make linux && make compress
- name: Push to bin/
uses: EndBug/add-and-commit@v9
with:
push: origin HEAD:main
add: ./licensing/bin/corlink-server --force
author_name: motortruck1221
author_email: motortruck1221@protonmail.com
aur-binary:
needs: aur-build
name: Upload to AUR (binary)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install UPX
run: sudo apt update && sudo apt install -y upx
- name: Extract tag
id: extract_tag
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//')"
- name: Setup SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
echo -e "Host aur.archlinux.org\n\tIdentityFile ~/.ssh/aur\n\tUser aur" > ~/.ssh/config
- name: Pull changes from AUR
run: |
sed -i "s/pkgver=.*/pkgver=${{ steps.extract_tag.outputs.version }}/" ./licensing/PKGBUILD
git clone aur@aur.archlinux.org:corlink-server.git
cp -rf ./licensing/README.md ./corlink-server/
cp -rf ./licensing/PKGBUILD ./corlink-server/
cp -rf ./LICENSE ./corlink-server/
cd corlink-server
git config --global user.email "${{ secrets.AUR_EMAIL }}"
git config --global user.name "${{ secrets.AUR_USERNAME }}"
cat PKGBUILD
- name: Validate PKGBUILD
uses: motortruck1221/arch-linux-pkgbuild-package@v2.2.1
with:
path: corlink-server
flags: ''
namcap: false
srcinfo: true
updpkgsums: true
- name: Push changes to AUR
run: |
cd corlink-server
git add .
git commit -m "Update to ${{ steps.extract_tag.outputs.version }}"
git push
aur-git:
needs: aur-build
name: Upload to AUR (git)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install UPX
run: sudo apt update && sudo apt install -y upx
- name: Extract tag
id: extract_tag
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//')"
- name: Setup SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
echo -e "Host aur.archlinux.org\n\tIdentityFile ~/.ssh/aur\n\tUser aur" > ~/.ssh/config
- name: Pull changes from AUR
run: |
sed -i "s/pkgver=.*/pkgver=${{ steps.extract_tag.outputs.version }}/" ./licensing/PKGBUILD
git clone aur@aur.archlinux.org:corlink-server-git.git
cp -rf ./licensing/README.md ./corlink-server-git/
cp -rf ./licensing/PKGBUILD-git ./corlink-server-git/PKGBUILD
cp -rf ./LICENSE ./corlink-server-git/
cd corlink-server-git
git config --global user.email "${{ secrets.AUR_EMAIL }}"
git config --global user.name "${{ secrets.AUR_USERNAME }}"
cat PKGBUILD
- name: Validate PKGBUILD
uses: motortruck1221/arch-linux-pkgbuild-package@v2.2.1
with:
path: corlink-server-git
flags: ''
namcap: false
srcinfo: true
updpkgsums: true
- name: Push changes to AUR
run: |
cd corlink-server-git
git add .
git commit -m "Update to ${{ steps.extract_tag.outputs.version }}"
git push
build-binaries:
name: Build Binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install UPX
run: sudo apt update && sudo apt install -y upx
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.6
- name: Build (All)
run: cd licensing/ && make all
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: binaries
path: ./licensing/bin/
retention-days: 2
download-upload-release:
name: Download & Upload Binaries to Release
runs-on: ubuntu-latest
needs: build-binaries
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download binaries
uses: actions/download-artifact@v4
with:
#download the binaries from the binaries job
name: binaries
path: ./licensing/bin/
# binaries worflow run id
- name: Make binaries executable
run: cd licensing/ && chmod +x bin/*
- name: Upload to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd licensing/
#get the release event when in beta
release=$(gh release list --limit 1 | awk '{print $1}')
# upload the artifact to the release
gh release upload $release bin/corlink-server --clobber
gh release upload $release bin/corlink-server-arm64 --clobber
gh release upload $release bin/corlink-server-arm --clobber
gh release upload $release bin/corlink-server-386 --clobber
gh release upload $release bin/corlink-server.exe --clobber
gh release upload $release bin/corlink-server-mac --clobber
gh release upload $release bin/corlink-server-mac-arm64 --clobber
gh release upload $release bin/corlink-server-compressed --clobber
gh release upload $release bin/corlink-server-arm64-compressed --clobber
gh release upload $release bin/corlink-server-arm-compressed --clobber
gh release upload $release bin/corlink-server-386-compressed --clobber
gh release upload $release bin/corlink-server-compressed.exe --clobber
gh release upload $release bin/corlink-server-mac-compressed --clobber
gh release upload $release bin/corlink-server-mac-arm64-compressed --clobber