-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (125 loc) · 4.52 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
on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
release-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
id: go_build
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64
compress_assets: false
executable_compression: upx
project_path: ./cmd/pbs_plus
ldflags: "-X 'main.Version=${{ github.event.release.tag_name }}'"
- name: pre-packaging script
env:
BINARY_PATH: ${{steps.go_build.outputs.release_asset_dir}}
run: ./build/package/pre-packaging.sh
- uses: jiro4989/build-deb-action@v3
with:
package: ${{ github.event.repository.name }}
package_root: build/package/debian
maintainer: Son Roy Almerol <[email protected]>
version: ${{ github.ref }} # refs/tags/v*.*.*
arch: 'amd64'
depends: 'proxmox-backup-server (>= 3.2), proxmox-backup-client (>= 3.2.5), rclone, fuse3'
desc: 'PBS Plus is a project focused on extending Proxmox Backup Server (PBS) with advanced features to create a more competitive backup solution'
homepage: 'https://github.com/${{ github.repository }}'
- name: Publish Release Assets
uses: softprops/action-gh-release@v1
with:
tag: ${{ github.event.release.tag_name }}
files: ./*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-windows-amd64-agent:
name: release agent windows/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
id: go_build
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: windows
goarch: amd64
compress_assets: false
executable_compression: upx
binary_name: pbs-plus-agent
project_path: ./cmd/windows_agent
ldflags: "-H=windowsgui -X 'main.Version=${{ github.event.release.tag_name }}'"
- uses: actions/upload-artifact@v4
with:
name: windows-binary
path: ${{steps.go_build.outputs.release_asset_dir}}/pbs-plus-agent.exe
release-windows-amd64-updater:
name: release updater windows/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
id: go_build_updater
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: windows
goarch: amd64
compress_assets: false
executable_compression: upx
binary_name: pbs-plus-updater
project_path: ./cmd/windows_updater
ldflags: "-H=windowsgui"
- uses: actions/upload-artifact@v4
with:
name: windows-updater-binary
path: ${{steps.go_build_updater.outputs.release_asset_dir}}/pbs-plus-updater.exe
release-windows-amd64-agent-installer:
name: release agent installer windows/amd64
runs-on: windows-latest
needs:
- release-windows-amd64-agent
- release-windows-amd64-updater
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: windows-binary
path: ./build/package/windows/
- uses: actions/download-artifact@v4
with:
name: windows-updater-binary
path: ./build/package/windows/
- id: version
shell: pwsh
run: |
$version = $env:GITHUB_REF -replace 'refs/tags/v', ''
echo "version=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- env:
MSI_NAME: "pbs-plus-agent-${{ github.event.release.tag_name }}-windows-installer.msi"
VERSION: ${{ env.version }}
shell: pwsh
run: |
choco install go-msi
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
$tempDir = Join-Path -Path $Env:GITHUB_WORKSPACE/build/package/windows -ChildPath "temp"
New-Item -Path $tempDir -ItemType Directory -Force
$env:TEMP = $tempDir
$env:TMP = $tempDir
cd ./build/package/windows
go-msi make --msi $env:MSI_NAME --version $env:VERSION
- name: Publish Release Assets
uses: softprops/action-gh-release@v1
with:
tag: ${{ github.event.release.tag_name }}
files: ./build/package/windows/*.msi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}