-
Notifications
You must be signed in to change notification settings - Fork 96
110 lines (101 loc) · 3.42 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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_${{ github.event.inputs.versionNumber }}.msi
- name: Upload installer
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: windows-artifact
path: Polaris_${{ github.event.inputs.versionNumber }}.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_${{ github.event.inputs.versionNumber }}.tar.gz
- name: Upload release
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: linux-artifact
path: Polaris_${{ github.event.inputs.versionNumber }}.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: 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