Merge 2f71cf2db7
into release
This commit is contained in:
commit
382681c7b1
1 changed files with 96 additions and 93 deletions
189
.github/workflows/release.yml
vendored
189
.github/workflows/release.yml
vendored
|
@ -2,43 +2,42 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
versionNumber:
|
versionNumber:
|
||||||
description: 'User-facing version number (eg: 0.13.0)'
|
description: "User-facing version number (eg: 0.13.0)"
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
name: Make Release
|
name: Make Release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
branch_and_tag:
|
branch_and_tag:
|
||||||
name: Update Release Branch
|
name: Update Release Branch
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Merge to Release Branch
|
- name: Merge to Release Branch
|
||||||
uses: devmasx/merge-branch@v1.3.1
|
uses: devmasx/merge-branch@v1.3.1
|
||||||
with:
|
with:
|
||||||
type: now
|
type: now
|
||||||
target_branch: release
|
target_branch: release
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Checkout Release Branch
|
- name: Checkout Release Branch
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
with:
|
with:
|
||||||
ref: release
|
ref: release
|
||||||
- name: Update Polaris Version in Cargo.toml
|
- name: Update Polaris Version in Cargo.toml
|
||||||
run: gawk -i inplace '/^version/ { if (count == 0) { $3 = "\"${{ github.event.inputs.versionNumber }}\""; count++ } } 1' 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
|
- name: Commit Cargo.toml Version Change
|
||||||
uses: EndBug/add-and-commit@v5
|
uses: EndBug/add-and-commit@v5
|
||||||
with:
|
with:
|
||||||
branch: release
|
branch: release
|
||||||
message: 'Updated version number'
|
message: "Updated version number"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Add <version number> Git Tag
|
- name: Add <version number> Git Tag
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name ${{ github.actor }}
|
git config --global user.name ${{ github.actor }}
|
||||||
git config --global user.email "<>"
|
git config --global user.email "<>"
|
||||||
git tag -f -a ${{ github.event.inputs.versionNumber }} -m "Version number"
|
git tag -f -a ${{ github.event.inputs.versionNumber }} -m "Version number"
|
||||||
git push -f --tags
|
git push -f --tags
|
||||||
|
|
||||||
create_release:
|
create_release:
|
||||||
name: Create Github Release
|
name: Create Github Release
|
||||||
|
@ -46,23 +45,23 @@ jobs:
|
||||||
needs: branch_and_tag
|
needs: branch_and_tag
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- 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: ${{ github.event.inputs.versionNumber }}
|
tag_name: ${{ github.event.inputs.versionNumber }}
|
||||||
release_name: Polaris ${{ github.event.inputs.versionNumber }}
|
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
|
||||||
run: echo "${{ steps.create_release.outputs.upload_url }}" > upload-url
|
run: echo "${{ steps.create_release.outputs.upload_url }}" > upload-url
|
||||||
- name: Store Upload URL
|
- name: Store Upload URL
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: release
|
name: release
|
||||||
path: upload-url
|
path: upload-url
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
name: Windows
|
name: Windows
|
||||||
|
@ -70,33 +69,35 @@ jobs:
|
||||||
needs: create_release
|
needs: create_release
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Polaris
|
- name: Checkout Polaris
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Install Rust Toolchain
|
with:
|
||||||
uses: actions-rs/toolchain@v1
|
ref: release
|
||||||
with:
|
- name: Install Rust Toolchain
|
||||||
profile: minimal
|
uses: actions-rs/toolchain@v1
|
||||||
- name: Make release
|
with:
|
||||||
uses: ./.github/actions/make-windows-release
|
profile: minimal
|
||||||
with:
|
- name: Make release
|
||||||
version-number: ${{ github.event.inputs.versionNumber }}
|
uses: ./.github/actions/make-windows-release
|
||||||
output-file: polaris.msi
|
with:
|
||||||
- name: Retrieve Upload URL
|
version-number: ${{ github.event.inputs.versionNumber }}
|
||||||
uses: actions/download-artifact@v1
|
output-file: polaris.msi
|
||||||
with:
|
- name: Retrieve Upload URL
|
||||||
name: release
|
uses: actions/download-artifact@v1
|
||||||
- name: Read Upload URL
|
with:
|
||||||
shell: bash
|
name: release
|
||||||
run: echo "UPLOAD_URL=$(cat release/upload-url)" >> $GITHUB_ENV
|
- name: Read Upload URL
|
||||||
- name: Upload Installer To Github Release
|
shell: bash
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
run: echo "UPLOAD_URL=$(cat release/upload-url)" >> $GITHUB_ENV
|
||||||
env:
|
- name: Upload Installer To Github Release
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
with:
|
env:
|
||||||
upload_url: ${{ env.UPLOAD_URL }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
asset_path: polaris.msi
|
with:
|
||||||
asset_name: Polaris_${{ github.event.inputs.versionNumber }}.msi
|
upload_url: ${{ env.UPLOAD_URL }}
|
||||||
asset_content_type: application/x-msi
|
asset_path: polaris.msi
|
||||||
|
asset_name: Polaris_${{ github.event.inputs.versionNumber }}.msi
|
||||||
|
asset_content_type: application/x-msi
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
name: Linux
|
name: Linux
|
||||||
|
@ -104,25 +105,27 @@ jobs:
|
||||||
needs: create_release
|
needs: create_release
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Polaris
|
- name: Checkout Polaris
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Make release
|
with:
|
||||||
uses: ./.github/actions/make-linux-release
|
ref: release
|
||||||
with:
|
- name: Make release
|
||||||
version-number: ${{ github.event.inputs.versionNumber }}
|
uses: ./.github/actions/make-linux-release
|
||||||
output-file: polaris.tar.gz
|
with:
|
||||||
- name: Retrieve Upload URL
|
version-number: ${{ github.event.inputs.versionNumber }}
|
||||||
uses: actions/download-artifact@v1
|
output-file: polaris.tar.gz
|
||||||
with:
|
- name: Retrieve Upload URL
|
||||||
name: release
|
uses: actions/download-artifact@v1
|
||||||
- name: Read Upload URL
|
with:
|
||||||
run: echo "UPLOAD_URL=$(cat release/upload-url)" >> $GITHUB_ENV
|
name: release
|
||||||
- name: Upload To Github Release
|
- name: Read Upload URL
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
run: echo "UPLOAD_URL=$(cat release/upload-url)" >> $GITHUB_ENV
|
||||||
env:
|
- name: Upload To Github Release
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
with:
|
env:
|
||||||
upload_url: ${{ env.UPLOAD_URL }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
asset_path: polaris.tar.gz
|
with:
|
||||||
asset_name: Polaris_${{ github.event.inputs.versionNumber }}.tar.gz
|
upload_url: ${{ env.UPLOAD_URL }}
|
||||||
asset_content_type: application/gzip
|
asset_path: polaris.tar.gz
|
||||||
|
asset_name: Polaris_${{ github.event.inputs.versionNumber }}.tar.gz
|
||||||
|
asset_content_type: application/gzip
|
||||||
|
|
Loading…
Add table
Reference in a new issue