forked from septag/glslcc
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (78 loc) · 3.33 KB
/
dist.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
name: dist
on:
workflow_run:
workflows: [build]
types: [completed]
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
version:
# test only
description: 'specify release tag name, default: 1.8.0'
# Default value if no value is explicitly provided
default: '1.8.0'
# Input has to be provided for the workflow to run
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
dist:
# The type of runner that the job will run on
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.inputs.version != '' }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
- name: Check release version
id: check_ver
shell: pwsh
run: |
$commit_msg = "$(git show -s --format=%s)"
echo "commit_msg: $commit_msg"
$matchInfo = [Regex]::Match($commit_msg, '\[release\s(\d+\.)+(-)?(\*|\d+)\]')
if ($matchInfo.Success) { $matchInfo = [Regex]::Match($matchInfo.Value, '(\d+\.)+(-)?(\*|\d+)') }
if (!$matchInfo.Success) { $matchInfo = [Regex]::Match('${{github.event.inputs.version}}', '(\d+\.)+(-)?(\*|\d+)') }
$release_ver = if($matchInfo.Success) { $matchInfo.Value } else { '' }
echo "release_ver=$release_ver"
echo "release_ver=$release_ver" >> ${env:GITHUB_OUTPUT}
echo "release_tag=v$release_ver" >> ${env:GITHUB_OUTPUT}
- name: Download artifacts from workflow build
if: ${{ steps.check_ver.outputs.release_ver != '' }}
uses: dawidd6/action-download-artifact@v2
with:
# Optional, GitHub token
github_token: ${{secrets.GITHUB_TOKEN}}
# Required, workflow file name or ID
workflow: build.yml
workflow_conclusion: success
- name: Create packages
if: ${{ steps.check_ver.outputs.release_ver != '' }}
run: |
curl -L https://github.com/simdsoft/1kiss/releases/download/devtools/d3dcompiler_47.dll -o ./axslcc-win64/d3dcompiler_47.dll
ls -l ./axslcc-win64
mkdir -p pkg_dir
prefix=axslcc-${{ steps.check_ver.outputs.release_ver }}
ls -l axslcc-linux
ls -l axslcc-osx-x64
ls -l axslcc-osx-arm64
sudo chmod u+x ./axslcc-linux/axslcc
sudo chmod u+x ./axslcc-osx-x64/axslcc
sudo chmod u+x ./axslcc-osx-arm64/axslcc
ls -l axslcc-linux
ls -l axslcc-osx-x64
ls -l axslcc-osx-arm64
tar -czvf ./pkg_dir/$prefix-linux.tar.gz -C ./axslcc-linux axslcc
tar -czvf ./pkg_dir/$prefix-osx-x64.tar.gz -C ./axslcc-osx-x64 axslcc
tar -czvf ./pkg_dir/$prefix-osx-arm64.tar.gz -C ./axslcc-osx-arm64 axslcc
sh -c "cd ./axslcc-win64; zip ../pkg_dir/$prefix-win64.zip axslcc.exe d3dcompiler_47.dll"
- name: Publish to github release page
if: ${{ steps.check_ver.outputs.release_ver != '' }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.check_ver.outputs.release_tag }}
name: ${{ steps.check_ver.outputs.release_tag }}
files: |
./pkg_dir/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: axmolengine/axslcc