Skip to content

Commit

Permalink
robot_failover: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Oct 29, 2024
1 parent 70eac05 commit 127b8ad
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 127b8ad

Please sign in to comment.