diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..494a774 --- /dev/null +++ b/.github/workflows/release.yml @@ -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