Make release from Github UI
This commit is contained in:
parent
9c45ad5238
commit
075a2953f8
6 changed files with 47 additions and 35 deletions
56
.github/workflows/release.yml
vendored
56
.github/workflows/release.yml
vendored
|
@ -1,27 +1,54 @@
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
tags:
|
inputs:
|
||||||
- '[0-9]+.[0-9]+.[0-9]+**'
|
versionNumber:
|
||||||
|
description: 'User facing version number (eg: 0.13.0)'
|
||||||
|
required: true
|
||||||
|
|
||||||
name: Release
|
name: Make Release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
branch_and_tag:
|
||||||
|
name: Update Release Branch
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Merge to Release Branch
|
||||||
|
uses: devmasx/merge-branch@v1.3.1
|
||||||
|
with:
|
||||||
|
type: now
|
||||||
|
target_branch: release
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Checkout Release Branch
|
||||||
|
uses: actions/checkout@master
|
||||||
|
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 And Tag Changes
|
||||||
|
uses: EndBug/add-and-commit@v5
|
||||||
|
with:
|
||||||
|
branch: release
|
||||||
|
message: 'Updated version number'
|
||||||
|
tag: '${{ github.event.inputs.versionNumber }} --force'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
create_release:
|
create_release:
|
||||||
name: Create Github Release
|
name: Create Github Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: branch_and_tag
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Read Polaris Version
|
|
||||||
run: echo "POLARIS_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
|
||||||
- name: Create Github Release
|
- name: Create Github Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1.0.0
|
uses: actions/create-release@v1.0.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.POLARIS_VERSION }}
|
tag_name: ${{ github.event.inputs.versionNumber }}
|
||||||
release_name: Polaris ${{ env.POLARIS_VERSION }}
|
release_name: Polaris ${{ github.event.inputs.versionNumber }}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
- name: Write Upload URL To Disk
|
- name: Write Upload URL To Disk
|
||||||
|
@ -40,9 +67,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Polaris
|
- name: Checkout Polaris
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Read Polaris Version
|
|
||||||
shell: bash
|
|
||||||
run: echo "POLARIS_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
|
||||||
- name: Install Rust Toolchain
|
- name: Install Rust Toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
@ -50,7 +74,7 @@ jobs:
|
||||||
- name: Make release
|
- name: Make release
|
||||||
uses: ./.github/actions/make-windows-release
|
uses: ./.github/actions/make-windows-release
|
||||||
with:
|
with:
|
||||||
version-number: ${{ env.POLARIS_VERSION }}
|
version-number: ${{ github.event.inputs.versionNumber }}
|
||||||
output-file: polaris.msi
|
output-file: polaris.msi
|
||||||
- name: Read Upload URL
|
- name: Read Upload URL
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -62,7 +86,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ env.UPLOAD_URL }}
|
upload_url: ${{ env.UPLOAD_URL }}
|
||||||
asset_path: polaris.msi
|
asset_path: polaris.msi
|
||||||
asset_name: Polaris_${{ env.POLARIS_VERSION }}.msi
|
asset_name: Polaris_${{ github.event.inputs.versionNumber }}.msi
|
||||||
asset_content_type: application/x-msi
|
asset_content_type: application/x-msi
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
|
@ -73,12 +97,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Polaris
|
- name: Checkout Polaris
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Read Polaris Version
|
|
||||||
run: echo "POLARIS_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
|
||||||
- name: Make release
|
- name: Make release
|
||||||
uses: ./.github/actions/make-linux-release
|
uses: ./.github/actions/make-linux-release
|
||||||
with:
|
with:
|
||||||
version-number: ${{ env.POLARIS_VERSION }}
|
version-number: ${{ github.event.inputs.versionNumber }}
|
||||||
output-file: polaris.tar.gz
|
output-file: polaris.tar.gz
|
||||||
- name: Retrieve Upload URL
|
- name: Retrieve Upload URL
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
|
@ -93,5 +115,5 @@ jobs:
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ env.UPLOAD_URL }}
|
upload_url: ${{ env.UPLOAD_URL }}
|
||||||
asset_path: polaris.tar.gz
|
asset_path: polaris.tar.gz
|
||||||
asset_name: Polaris_${{ env.POLARIS_VERSION }}.tar.gz
|
asset_name: Polaris_${{ github.event.inputs.versionNumber }}.tar.gz
|
||||||
asset_content_type: application/gzip
|
asset_content_type: application/gzip
|
||||||
|
|
4
.github/workflows/validate-install.yml
vendored
4
.github/workflows/validate-install.yml
vendored
|
@ -20,7 +20,7 @@ jobs:
|
||||||
- name: Make release
|
- name: Make release
|
||||||
uses: ./.github/actions/make-linux-release
|
uses: ./.github/actions/make-linux-release
|
||||||
with:
|
with:
|
||||||
version-number: '0.0'
|
version-number: '0.0.0'
|
||||||
output-file: polaris.tar.gz
|
output-file: polaris.tar.gz
|
||||||
- name: Upload packaged release
|
- name: Upload packaged release
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
@ -104,7 +104,7 @@ jobs:
|
||||||
- name: Make release
|
- name: Make release
|
||||||
uses: ./.github/actions/make-windows-release
|
uses: ./.github/actions/make-windows-release
|
||||||
with:
|
with:
|
||||||
version-number: '0.0'
|
version-number: '0.0.0'
|
||||||
output-file: polaris.msi
|
output-file: polaris.msi
|
||||||
- name: Upload packaged release
|
- name: Upload packaged release
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1394,7 +1394,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "polaris"
|
name = "polaris"
|
||||||
version = "0.12.4"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ape",
|
"ape",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "polaris"
|
name = "polaris"
|
||||||
version = "0.12.4"
|
version = "0.0.0"
|
||||||
authors = ["Antoine Gersant <antoine.gersant@lesforges.org>"]
|
authors = ["Antoine Gersant <antoine.gersant@lesforges.org>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# Maintenance
|
# Maintenance
|
||||||
|
|
||||||
## How to make a release
|
## How to make a release
|
||||||
|
- On Github, go to **Actions**, select the **Make Release** workflow and click **Run workflow**
|
||||||
- `git pull` to not miss out on any recent contributions
|
- Select the branch to deploy (usually `master`)
|
||||||
- Update version number in Cargo.toml and commit the change (no need to push)
|
- Input a user-facing version name (eg: **0.13.0**)
|
||||||
- Run `make_release.ps1`
|
- Click the **Run workflow** button
|
||||||
- After CI completes, find the release on Github and write the changelog
|
- After CI completes, find the release on Github and write the changelog
|
||||||
- Move the release from Draft to Published
|
- Move the release from Draft to Published
|
||||||
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
Get-ChildItem "Cargo.toml" | ForEach-Object {
|
|
||||||
$conf = $_ | Get-Content -raw
|
|
||||||
$conf -match 'version\s+=\s+"(.*)"' | out-null
|
|
||||||
$script:POLARIS_VERSION = $matches[1]
|
|
||||||
}
|
|
||||||
|
|
||||||
git tag -d $POLARIS_VERSION
|
|
||||||
git push --delete origin $POLARIS_VERSION
|
|
||||||
git tag $POLARIS_VERSION
|
|
||||||
git push --tags
|
|
Loading…
Add table
Reference in a new issue