-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.25 KB
/
create-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
name: create-release
on:
workflow_call:
inputs:
runs-on:
type: string
default: self-hosted
version:
description: Use to override the default generated version
required: false
type: string
token:
type: string
description: Access token used when creating the release, using GITHUB_TOKEN will not fire any additional workflows like on:release:published
required: false
jobs:
release:
runs-on: ${{ inputs.runs-on }}
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v4
- name: Generate version number - Windows OS
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
echo "VERSION=$((Get-Date).ToString("yyyy.MM.dd.HHmm"))" >> $env:GITHUB_ENV
- name: Generate version number - Linux/Mac OS
if: ${{ runner.os != 'Windows' }}
run: |
echo "VERSION=$(date +"%Y.%m.%d.%H%M")" >> ${GITHUB_ENV}
- name: Create release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.CREATE_RELEASE_PAT }}
name: v${{ env.VERSION }}
tag_name: ${{ env.VERSION }}
generate_release_notes: true
make_latest: true