Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade makemhr workflow to build and upload utils #1026

Merged
merged 11 commits into from
Aug 8, 2024
42 changes: 26 additions & 16 deletions .github/workflows/makemhr.yml → .github/workflows/utils.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
name: makemhr
name: utils

on:
push:
paths:
- 'utils/makemhr/**'
- '.github/workflows/makemhr.yml'
- 'utils/**'
- '.github/workflows/utils.yml'

workflow_dispatch:

env:
BUILD_TYPE: Release
Branch: ${{github.ref_name}}

jobs:
Win64:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
- name: Clone repo and submodules
run: git clone https://github.com/${{github.repository}}.git . --branch ${{env.Branch}}

- name: Get current date
run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV

- name: Get commit hash
run: echo "CommitHash=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
- name: Get current date, commit hash and count
run: |
echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $env:GITHUB_ENV
echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
echo "CommitCount=$(git rev-list --count ${{env.Branch}} --)" >> $env:GITHUB_ENV

- name: Clone libmysofa
run: git clone --depth 1 --branch v1.3.1 https://github.com/hoene/libmysofa.git libmysofa
run: |
git clone https://github.com/ThreeDeeJay/libmysofa.git
cd libmysofa
git checkout 8642646ee6caca9085456bfa9d731200d68c25ca

- name: Add MSBuild to PATH
uses: microsoft/[email protected]
Expand All @@ -52,25 +57,30 @@ jobs:
- name: Collect artifacts
run: |
copy "build/Release/makemhr.exe" "Artifacts/makemhr.exe"
copy "build/Release/sofa-info.exe" "Artifacts/sofa-info.exe"
copy "build/Release/alrecord.exe" "Artifacts/alrecord.exe"
copy "build/Release/altonegen.exe" "Artifacts/altonegen.exe"
copy "build/Release/openal-info.exe" "Artifacts/openal-info.exe"
copy "build/Release/allafplay.exe" "Artifacts/allafplay.exe"
copy "libmysofa/windows/third-party/zlib-1.2.11/bin/zlib.dll" "Artifacts/zlib.dll"

- name: Upload makemhr artifact
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: makemhr
name: ${{env.CommitDate}}_utils-r${{env.CommitCount}}@${{env.CommitHashShort}}
path: "Artifacts/"

- name: Compress artifacts
uses: papeloto/action-zip@v1
with:
files: Artifacts/
dest: "Release/makemhr.zip"
dest: "Release/utils.zip"

- name: GitHub pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: "makemhr"
automatic_release_tag: "utils"
prerelease: true
title: "[${{env.CurrentDate}}] makemhr-${{env.CommitHash}}"
files: "Release/makemhr.zip"
title: "[${{env.CommitDate}}] utils-r${{env.CommitCount}}@${{env.CommitHashShort}}"
files: "Release/utils.zip"