forked from alxhlz/hcloud-failover-keepalived
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
robot_failover: add release workflow
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 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,70 @@ | ||
name: Build pex & deb for release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
refresh: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# pulls all commits (needed for lerna / semantic release to correctly version) | ||
fetch-depth: "0" | ||
# pulls all tags (needed for lerna / semantic release to correctly version) | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- uses: cachix/install-nix-action@v22 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs | ||
- run: nix-channel --update | ||
- run: ./pex.sh | ||
- run: ./deb.sh | ||
- name: Store pex | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pex | ||
path: robot_failover.pex | ||
- name: Store deb | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: deb | ||
path: robot_failover.deb | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.cversion.outputs.version }} | ||
release_name: Release v${{ steps.cversion.outputs.version }} | ||
body: | | ||
Install from mgit dpkg repo once released there | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset .deb | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: robot_failover.deb | ||
asset_name: robot-failover-${{ steps.cversion.outputs.version }}.deb | ||
asset_content_type: application/vnd.debian.binary-package | ||
|
||
- name: Upload Release Asset .pex | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: robot_failover.pex | ||
asset_name: robot-failover-${{ steps.cversion.outputs.version }}.pex | ||
asset_content_type: application/zip |