|
1 | 1 | name: Release |
2 | 2 | on: |
| 3 | + schedule: |
| 4 | + - cron: "0 12 * * *" |
3 | 5 | workflow_dispatch: |
4 | 6 | inputs: |
5 | 7 | version: |
6 | 8 | description: "Version Number" |
7 | | - required: true |
8 | 9 | type: string |
9 | | - linux: |
10 | | - description: "Linux Platform Type" |
11 | | - required: false |
12 | | - default: ubuntu-latest |
13 | | - type: choice |
14 | | - options: |
15 | | - - ubuntu-latest |
16 | | - - ubuntu-22.04 |
17 | | - - ubuntu-20.04 |
18 | | - - ubuntu-18.04 |
19 | | - windows: |
20 | | - description: "Windows Platform Type" |
21 | | - required: false |
22 | | - default: windows-latest |
23 | | - type: choice |
24 | | - options: |
25 | | - - windows-latest |
26 | | - - windows-2022 |
27 | | - - windows-2019 |
28 | | - macOS: |
29 | | - description: "macOS Platform Type" |
30 | | - required: false |
31 | | - default: macos-latest |
32 | | - type: choice |
33 | | - options: |
34 | | - - macos-latest |
35 | | - - macos-12 |
36 | | - - macos-11 |
37 | | - - macos-10.15 |
| 10 | + push: |
| 11 | + tags: |
| 12 | + - v[0-9]+.[0-9]+.[0-9]+ |
38 | 13 | jobs: |
| 14 | + version: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + version: ${{ steps.version.outputs.version || steps.custom.outputs.version || steps.tag.outputs.version }} |
| 18 | + steps: |
| 19 | + - name: Output Version |
| 20 | + id: version |
| 21 | + if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version == '' ) }} |
| 22 | + run: echo "version=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT |
| 23 | + - name: Output Custom Version |
| 24 | + id: custom |
| 25 | + if: ${{ github.event_name == 'workflow_dispatch' && inputs.version != '' }} |
| 26 | + run: echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT |
| 27 | + - name: Output Tag |
| 28 | + id: tag |
| 29 | + if: ${{ github.event_name == 'push' }} |
| 30 | + run: echo "version=$(echo ${GITHUB_REF#refs/*/} | sed -e 's/v//')" >> $GITHUB_OUTPUT |
39 | 31 | linux: |
| 32 | + needs: version |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04] |
40 | 36 | uses: ./.github/workflows/release-linux.yml |
41 | 37 | with: |
42 | | - version: ${{ inputs.version }} |
43 | | - platform: ${{ inputs.linux }} |
| 38 | + version: ${{ needs.version.outputs.version }} |
| 39 | + platform: ${{ matrix.os }} |
44 | 40 | windows: |
| 41 | + needs: version |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + os: [windows-2022, windows-2019] |
45 | 45 | uses: ./.github/workflows/release-windows.yml |
46 | 46 | with: |
47 | | - version: ${{ inputs.version }} |
48 | | - platform: ${{ inputs.windows }} |
| 47 | + version: ${{ needs.version.outputs.version }} |
| 48 | + platform: ${{ matrix.os }} |
49 | 49 | mac: |
| 50 | + needs: version |
| 51 | + strategy: |
| 52 | + matrix: |
| 53 | + os: [macos-12, macos-11, macos-10.15] |
50 | 54 | uses: ./.github/workflows/release-mac.yml |
51 | 55 | with: |
52 | | - version: ${{ inputs.version }} |
53 | | - platform: ${{ inputs.macOS }} |
| 56 | + version: ${{ needs.version.outputs.version }} |
| 57 | + platform: ${{ matrix.os }} |
0 commit comments