| 1 |
name: Release |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- 'v*' |
| 7 |
|
| 8 |
jobs: |
| 9 |
|
| 10 |
release-linux: |
| 11 |
name: Build the Linux release artifact |
| 12 |
runs-on: [ self-hosted, linux, x64 ] |
| 13 |
# Trust that the runner has an sbuild chroot |
| 14 |
# sudo apt install autorevision sbuild-debian-developer-setup debhelper dh-golang |
| 15 |
# newgrp sbuild |
| 16 |
# sudo sbuild-debian-developer-setup --suite=stable |
| 17 |
|
| 18 |
steps: |
| 19 |
- name: Remove old release artifacts |
| 20 |
run: rm -f ../kel-agent_* |
| 21 |
|
| 22 |
- name: Checkout code |
| 23 |
uses: actions/checkout@v3 |
| 24 |
|
| 25 |
- name: Test |
| 26 |
run: make test |
| 27 |
|
| 28 |
- name: Build Debian package |
| 29 |
run: make deb-package |
| 30 |
|
| 31 |
- name: Release |
| 32 |
uses: softprops/action-gh-release@v1 |
| 33 |
if: startsWith(github.ref, 'refs/tags/') |
| 34 |
with: |
| 35 |
files: ../*.deb |
| 36 |
env: |
| 37 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 38 |
|
| 39 |
release-rpi: |
| 40 |
name: Build the Raspberry Pi release artifact |
| 41 |
runs-on: [ self-hosted, linux, ARM ] |
| 42 |
# Trust that the runner has an sbuild chroot: |
| 43 |
# sudo apt install autorevision sbuild-debian-developer-setup debhelper dh-golang |
| 44 |
# newgrp sbuild |
| 45 |
# sudo sbuild-debian-developer-setup --suite=stable |
| 46 |
|
| 47 |
steps: |
| 48 |
- name: Remove old release artifacts |
| 49 |
run: rm -f ../kel-agent_* |
| 50 |
|
| 51 |
- name: Checkout code |
| 52 |
uses: actions/checkout@v3 |
| 53 |
|
| 54 |
- name: Test |
| 55 |
run: make test |
| 56 |
|
| 57 |
- name: Build Debian package |
| 58 |
run: make deb-package |
| 59 |
|
| 60 |
- name: Release |
| 61 |
uses: softprops/action-gh-release@v1 |
| 62 |
if: startsWith(github.ref, 'refs/tags/') |
| 63 |
with: |
| 64 |
files: ../*.deb |
| 65 |
env: |
| 66 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 |
|
| 68 |
release-flatpak: |
| 69 |
name: Build the Flatpak release artifact |
| 70 |
runs-on: ubuntu-latest |
| 71 |
container: |
| 72 |
image: bilelmoussaoui/flatpak-github-actions:freedesktop-20.08 |
| 73 |
options: --privileged |
| 74 |
|
| 75 |
steps: |
| 76 |
- name: Checkout code |
| 77 |
uses: actions/checkout@v3 |
| 78 |
|
| 79 |
- name: Build Flatpak |
| 80 |
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 |
| 81 |
with: |
| 82 |
bundle: kel-agent.flatpak |
| 83 |
manifest-path: flatpak/radio.k0swe.Kel_Agent.yml |
| 84 |
branch: main |
| 85 |
cache-key: flatpak-builder-${{ github.sha }} |
| 86 |
|
| 87 |
- name: Release |
| 88 |
uses: softprops/action-gh-release@v1 |
| 89 |
if: startsWith(github.ref, 'refs/tags/') |
| 90 |
with: |
| 91 |
files: kel-agent.flatpak |
| 92 |
env: |
| 93 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 94 |
|
| 95 |
release-macos: |
| 96 |
name: Build the MacOS release artifact |
| 97 |
runs-on: macos-latest |
| 98 |
|
| 99 |
steps: |
| 100 |
- name: Install WhiteBox Packages |
| 101 |
run: | |
| 102 |
curl "http://s.sudre.free.fr/Software/files/Packages.dmg" --output ${HOME}/Packages.dmg |
| 103 |
sudo hdiutil attach ${HOME}/Packages.dmg |
| 104 |
find /Volumes -name "Install Packages.pkg" | xargs -I {} sudo installer -pkg "{}" -target / |
| 105 |
|
| 106 |
- name: Create keychain with signing certificate |
| 107 |
uses: apple-actions/import-codesign-certs@v1 |
| 108 |
with: |
| 109 |
keychain: k0swe |
| 110 |
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} |
| 111 |
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} |
| 112 |
|
| 113 |
- name: Checkout code |
| 114 |
uses: actions/checkout@v3 |
| 115 |
|
| 116 |
- name: Test |
| 117 |
run: make test |
| 118 |
|
| 119 |
- name: Build Mac package |
| 120 |
run: make mac-package |
| 121 |
|
| 122 |
- name: Release |
| 123 |
uses: softprops/action-gh-release@v1 |
| 124 |
if: startsWith(github.ref, 'refs/tags/') |
| 125 |
with: |
| 126 |
files: kel-agent_mac.pkg |
| 127 |
env: |
| 128 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 129 |
|
| 130 |
release-windows: |
| 131 |
name: Build the Windows release artifact |
| 132 |
runs-on: windows-latest |
| 133 |
|
| 134 |
steps: |
| 135 |
- name: Install Go |
| 136 |
uses: actions/setup-go@v3 |
| 137 |
with: |
| 138 |
go-version: 1.15.x |
| 139 |
|
| 140 |
- name: Checkout code |
| 141 |
uses: actions/checkout@v3 |
| 142 |
|
| 143 |
- name: Test |
| 144 |
run: make test |
| 145 |
|
| 146 |
- name: Build Windows package |
| 147 |
run: | |
| 148 |
$env:PATH += ";$env:WIX\bin" |
| 149 |
make win-package |
| 150 |
|
| 151 |
- name: Release |
| 152 |
uses: softprops/action-gh-release@v1 |
| 153 |
if: startsWith(github.ref, 'refs/tags/') |
| 154 |
with: |
| 155 |
files: win/kel-agent.msi |
| 156 |
env: |
| 157 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |