-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate dev builds from release builds
- Loading branch information
1 parent
be2142e
commit 5d834ae
Showing
2 changed files
with
83 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
dev-build-linux-amd64: | ||
name: dev build 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 | ||
overwrite: true | ||
release_tag: dev | ||
- 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: 'refs/tags/v0.0.0' | ||
arch: 'amd64' | ||
depends: 'proxmox-backup (>= 3.2), proxmox-backup-client (>= 3.2.5), rclone' | ||
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: Pre-release dev build | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag: dev | ||
files: ./*.deb | ||
prerelease: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
dev-build-windows-amd64-agent: | ||
name: dev build 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 | ||
overwrite: true | ||
release_tag: dev |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
on: | ||
release: | ||
types: [created] | ||
push: | ||
branches: | ||
- main | ||
tags: [ 'v*.*.*' ] | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release-linux-amd64: | ||
|
@@ -22,38 +20,27 @@ jobs: | |
goos: linux | ||
goarch: amd64 | ||
compress_assets: false | ||
executable_compression: upx | ||
executable_compression: upx | ||
project_path: ./cmd/pbs_plus | ||
overwrite: true | ||
- name: pre-packaging script | ||
env: | ||
BINARY_PATH: ${{ steps.go_build.outputs.release_asset_dir }} | ||
run: ./build/package/pre-packaging.sh | ||
- id: new_ref | ||
run: | | ||
new_ref="$GITHUB_REF" | ||
if [[ "$GITHUB_REF" == "refs/heads/main" || "$GITHUB_REF" == "refs/tags/main" ]]; then | ||
new_ref="refs/tags/v0.0.0" | ||
fi | ||
echo "new_ref=$new_ref" >> "$GITHUB_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: ${{ github.event.repository.name }} | ||
package_root: build/package/debian | ||
maintainer: Son Roy Almerol <[email protected]> | ||
version: ${{ env.new_ref }} | ||
maintainer: Son Roy Almerol <[email protected]> | ||
version: ${{ github.ref }} # refs/tags/v*.*.* | ||
arch: 'amd64' | ||
depends: 'proxmox-backup (>= 3.2), proxmox-backup-client (>= 3.2.5), rclone' | ||
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 or Dev Pre-Release Assets | ||
if: github.event_name == 'release' || github.ref == 'refs/heads/main' | ||
- name: Publish Release Assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag: ${{ github.event.release.tag_name || 'main' }} | ||
tag: ${{ github.event.release.tag_name }} | ||
files: ./*.deb | ||
prerelease: ${{ github.ref == 'refs/heads/main' || github.event.release.tag_name == 'main' }} # Set as pre-release if this is a dev build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -66,24 +53,21 @@ jobs: | |
id: go_build | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: windows | ||
goos: windows | ||
goarch: amd64 | ||
compress_assets: false | ||
executable_compression: upx | ||
executable_compression: upx | ||
binary_name: pbs-plus-agent | ||
project_path: ./cmd/windows_agent | ||
ldflags: -H=windowsgui | ||
overwrite: true | ||
- uses: actions/upload-artifact@v4 | ||
if: github.event_name == 'release' && github.event.release.tag_name != 'main' | ||
with: | ||
name: windows-binary | ||
path: ${{ steps.go_build.outputs.release_asset_dir }}/pbs-plus-agent.exe | ||
path: ${{steps.go_build.outputs.release_asset_dir}}/pbs-plus-agent.exe | ||
|
||
release-windows-amd64-agent-installer: | ||
name: release agent installer windows/amd64 | ||
runs-on: windows-latest | ||
if: github.event_name == 'release' && github.event.release.tag_name != 'main' | ||
needs: release-windows-amd64-agent | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -110,10 +94,11 @@ jobs: | |
$env:TMP = $tempDir | ||
cd ./build/package/windows | ||
go-msi make --msi $env:MSI_NAME --version $env:VERSION | ||
- name: Publish Release | ||
- 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 }} | ||
|