.github/workflows/release.yml #103
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_d2d_backup | |
- 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 <github@snry.me> | |
version: ${{ github.ref }} # refs/tags/v*.*.* | |
arch: 'amd64' | |
depends: 'proxmox-backup (>= 3.2), proxmox-backup-client (>= 3.2.5), rclone' | |
desc: 'A Proxmox Backup Server (PBS) proxy server that adds a "disk-to-disk" file backup functionality within PBS Web UI' | |
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-d2d-agent | |
project_path: ./cmd/pbs_windows_agent | |
ldflags: -H=windowsgui | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows-binary | |
path: ${{steps.go_build.outputs.release_asset_dir}}/pbs-d2d-agent.exe | |
release-windows-amd64-agent-installer: | |
name: release agent installer windows/amd64 | |
runs-on: windows-latest | |
needs: release-windows-amd64-agent | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: windows-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-d2d-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 }} | |