Skip to content

Make Release

Make Release #77

Workflow file for this run

on:
workflow_dispatch:
inputs:
versionNumber:
description: "User-facing version number (eg: 0.13.0)"
required: true
name: Make Release
jobs:
branch_and_tag:
name: Update Release Branch
runs-on: ubuntu-latest
steps:
- name: Merge to Release Branch
uses: devmasx/[email protected]
with:
type: now
target_branch: release
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Release Branch
uses: actions/checkout@v4
with:
ref: release
- name: Update Polaris Version in Cargo.toml
run: gawk -i inplace '/^version/ { if (count == 0) { $3 = "\"${{ github.event.inputs.versionNumber }}\""; count++ } } 1' Cargo.toml
- name: Commit Cargo.toml Version Change
uses: EndBug/add-and-commit@v9
with:
message: "Updated version number"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add <version number> Git Tag
run: |
git config --global user.name ${{ github.actor }}
git config --global user.email "<>"
git tag -f -a ${{ github.event.inputs.versionNumber }} -m "Version number"
git push -f --tags
windows:
name: Windows
runs-on: windows-latest
needs: branch_and_tag
steps:
- name: Checkout Polaris
uses: actions/checkout@v4
with:
ref: release
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
- name: Make release
uses: ./.github/actions/make-windows-release
with:
version-number: ${{ github.event.inputs.versionNumber }}
output-file: polaris.msi
- name: Upload installer
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Polaris_${{ github.event.inputs.versionNumber }}.msi
path: polaris.msi
linux:
name: Linux
runs-on: ubuntu-latest
needs: branch_and_tag
steps:
- name: Checkout Polaris
uses: actions/checkout@v4
with:
ref: release
- name: Make release
uses: ./.github/actions/make-linux-release
with:
version-number: ${{ github.event.inputs.versionNumber }}
output-file: polaris.tar.gz
- name: Upload release
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Polaris_${{ github.event.inputs.versionNumber }}.tar.gz
path: polaris.tar.gz
create_release:
name: Create Github Release
runs-on: ubuntu-latest
needs: [windows, linux]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Troublshooting
run: ls -R
- name: Make Github release
uses: softprops/action-gh-release@v2
with:
body: 'Release notes are documented in [CHANGELOG.md](https://github.com/agersant/polaris/blob/master/CHANGELOG.md)'
draft: true
prerelease: false
name: Polaris ${{ github.event.inputs.versionNumber }}
tag_name: ${{ github.event.inputs.versionNumber }}
fail_on_unmatched_files: true
files: |
Polaris_${{ github.event.inputs.versionNumber }}.tar.gz
Polaris_${{ github.event.inputs.versionNumber }}.msi