Skip to content

Commit

Permalink
Try to improve actions
Browse files Browse the repository at this point in the history
  • Loading branch information
LAGonauta committed Dec 12, 2023
1 parent 0ed3d18 commit cc69334
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ jobs:
submodules: recursive
fetch-depth: 0

- name: Get branch name
run: echo "BranchName=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $env:GITHUB_ENV

- name: Get commit hash
run: echo "CommitHash=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV

- name: Get commit count
run: echo "CommitCount=$(git rev-list --count master)" >> $env:GITHUB_ENV
run: echo "CommitCount=$(git rev-list --count ${{env.BranchName}})" >> $env:GITHUB_ENV

- name: Get current date
run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV
Expand Down Expand Up @@ -82,8 +85,8 @@ jobs:

- name: Download MetaHook
run: |
Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231124b/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip
if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("4B22EA01E0B025CAEABD7301FEF52FA05A807263B8B761760FA3AAD7E1D2EA23")) {
Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231210a/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip
if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("E5F3DB974C0D00241125757A6CE83E1BCF114D156E8E3E27C7622CAE7DDE36A1")) {
Exit -1
}
Expand-Archive ./MetaHook.zip -DestinationPath MetaHook/
Expand All @@ -103,10 +106,10 @@ jobs:
uses: papeloto/action-zip@v1
with:
files: 'Output/'
dest: 'Release/${{env.CurrentDate}}_MetaAudio-${{env.CommitCount}}@${{env.CommitHash}}.zip'
dest: 'Release/${{env.CurrentDate}}_MetaAudio-${{env.CommitCount}}@${{env.CommitHash}}-${{env.BranchName}}.zip'

- name: Make copy for static download URL
run: copy 'Release/${{env.CurrentDate}}_MetaAudio-${{env.CommitCount}}@${{env.CommitHash}}.zip' 'Release/MetaAudio.zip'
run: copy 'Release/${{env.CurrentDate}}_MetaAudio-${{env.CommitCount}}@${{env.CommitHash}}-${{env.BranchName}}.zip' 'Release/MetaAudio.zip'

- name: GitHub pre-release
uses: 'marvinpinto/action-automatic-releases@latest'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:

- name: Download MetaHook
run: |
Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231124b/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip
if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("4B22EA01E0B025CAEABD7301FEF52FA05A807263B8B761760FA3AAD7E1D2EA23")) {
Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231210a/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip
if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("E5F3DB974C0D00241125757A6CE83E1BCF114D156E8E3E27C7622CAE7DDE36A1")) {
Exit -1
}
Expand-Archive ./MetaHook.zip -DestinationPath MetaHook/
Expand Down

0 comments on commit cc69334

Please sign in to comment.