-
Notifications
You must be signed in to change notification settings - Fork 27
139 lines (139 loc) · 4.86 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release
on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
inputs:
version:
description: "Version Number (x.y.z)"
type: string
release:
description: "Create Release?"
required: false
default: false
type: boolean
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version || steps.custom.outputs.version || steps.tag.outputs.version }}
steps:
- name: Output Version
id: version
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version == '' ) }}
run: echo "version=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
- name: Output Custom Version
id: custom
if: ${{ github.event_name == 'workflow_dispatch' && inputs.version != '' }}
run: echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
- name: Output Tag
id: tag
if: ${{ github.event_name == 'push' }}
run: echo "version=$(echo ${GITHUB_REF#refs/*/} | sed -e 's/v//')" >> $GITHUB_OUTPUT
linux:
needs: version
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
uses: ./.github/workflows/release-linux.yml
with:
version: ${{ needs.version.outputs.version }}
platform: ${{ matrix.os }}
windows:
needs: version
strategy:
matrix:
os: [windows-2022, windows-2019]
uses: ./.github/workflows/release-windows.yml
with:
version: ${{ needs.version.outputs.version }}
platform: ${{ matrix.os }}
mac:
needs: version
strategy:
matrix:
os: [macos-12, macos-11]
uses: ./.github/workflows/release-mac.yml
with:
version: ${{ needs.version.outputs.version }}
platform: ${{ matrix.os }}
release:
needs: [version, linux, windows, mac]
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }} # Set job-level output
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')
steps:
- name: Create Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.version.outputs.version }}
release_name: Release ${{ needs.version.outputs.version }}
draft: false
prerelease: false
release-upload-linux:
needs: [version, release]
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
runs-on: ubuntu-latest
steps:
- name: Download .deb Artifact
uses: actions/download-artifact@v2
with:
name: AsTeRICS ${{ needs.version.outputs.version }} (${{ matrix.os }})
- name: Upload Release Asset (Linux)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./asterics-are-${{ needs.version.outputs.version }}.deb
asset_name: asterics-are-${{ needs.version.outputs.version }}-${{ matrix.os }}.deb
asset_content_type: application/vnd.debian.binary-package
release-upload-windows:
needs: [version, release]
strategy:
matrix:
os: [windows-2022, windows-2019]
runs-on: ubuntu-latest
steps:
- name: Download .exe Artifact
uses: actions/download-artifact@v2
with:
name: AsTeRICS ${{ needs.version.outputs.version }} (${{ matrix.os }})
- name: Upload Release Asset (Windows)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./Setup_AsTeRICS_${{ needs.version.outputs.version }}.exe
asset_name: Setup_AsTeRICS_${{ needs.version.outputs.version }}_${{ matrix.os }}.exe
asset_content_type: application/x-msdownload
release-upload-mac:
needs: [version, release]
strategy:
matrix:
os: [macos-12, macos-11]
runs-on: ubuntu-latest
steps:
- name: Download .dmg Artifact
uses: actions/download-artifact@v2
with:
name: AsTeRICS ${{ needs.version.outputs.version }} (${{ matrix.os }})
- name: Upload Release Asset (macOS)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./asterics-are-javaembedded-${{ needs.version.outputs.version }}.dmg
asset_name: asterics-are-javaembedded-${{ needs.version.outputs.version }}-${{ matrix.os }}.dmg
asset_content_type: application/x-apple-diskimage