Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

dist

dist #16

Workflow file for this run

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@v6
with:
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref }}
- name: Check release version
id: check_ver
shell: pwsh
run: |
# commit message template: Version 1.8.0
$commit_msg = "$(git show -s --format=%s)"
echo "Parsing release version from commit message: $commit_msg"
$matchInfo = [Regex]::Match($commit_msg, '^Version\s+(?<ver>\d+\.\d+\.\d+)$')
if(!$matchInfo.Success) { $matchInfo = [Regex]::Match('${{github.event.inputs.version}}', '^(?<ver>\d+\.\d+\.\d+(-\w+)?)$') }
if($matchInfo.Success) { $release_ver = $matchInfo.Groups['ver'].Value } else { $release_ver='' }
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@v11
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 }}
target_commitish: "${{ github.head_ref || github.ref_name }}"
files: |
./pkg_dir/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: simdsoft/axslcc