-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): Add manual release workflow (#27)
* style(ci): Fix some indentation * chore(ci): Update AutoHotkey version * feat(ci): Add manual release workflow
- Loading branch information
Showing
5 changed files
with
152 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# See https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
|
||
name: Install AHK | ||
|
||
inputs: | ||
ahk-v2-url: | ||
default: https://github.com/AutoHotkey/AutoHotkey/releases/download/v2.0.11/AutoHotkey_2.0.11.zip | ||
ahk2exe-url: | ||
default: https://github.com/AutoHotkey/Ahk2Exe/releases/download/Ahk2Exe1.1.37.02a0/Ahk2Exe1.1.37.02a0.zip | ||
|
||
outputs: | ||
ahk-path: | ||
value: ${{ steps.extract.outputs.ahk-path }} | ||
ahk2exe-path: | ||
value: ${{ steps.extract.outputs.ahk2exe-path }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Download and extract AutoHotkey | ||
id: extract | ||
shell: pwsh | ||
run: | | ||
irm -OutFile autohotkey.zip $env:AHK_V2_URL | ||
unzip autohotkey.zip -d autohotkey | ||
irm -OutFile ahk2exe.zip $env:AHK2EXE_URL | ||
unzip ahk2exe.zip -d autohotkey\Compiler | ||
echo "ahk-path=$(pwd)\\autohotkey\AutoHotkey64.exe" >>$env:GITHUB_OUTPUT | ||
echo "ahk2exe-path=$(pwd)\\autohotkey\\Compiler\\Ahk2Exe.exe" >>$env:GITHUB_OUTPUT | ||
env: | ||
AHK_V2_URL: ${{ inputs.ahk-v2-url }} | ||
AHK2EXE_URL: ${{ inputs.ahk2exe-url }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- ahk-v2 | ||
pull_request: | ||
branches: | ||
- ahk-v2 | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install AutoHotkey | ||
id: install-ahk | ||
uses: ./.github/actions/install-ahk | ||
|
||
- name: Embed script with Ahk2Exe | ||
run: ./scripts/embed.ps1 | ||
env: | ||
AHK_STUB: ${{ steps.install-ahk.outputs.ahk-path }} | ||
AHK2EXE: ${{ steps.install-ahk.outputs.ahk2exe-path }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: mwm | ||
path: | | ||
build/mwm.exe | ||
build/mwm.ahk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Validate input | ||
shell: bash | ||
run: | | ||
[[ $VERSION =~ v[0-9]+\.[0-9]+\.[0-9]+ ]] | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install AutoHotkey | ||
id: install-ahk | ||
uses: ./.github/actions/install-ahk | ||
|
||
- name: Embed script with Ahk2Exe | ||
run: ./scripts/embed.ps1 | ||
env: | ||
AHK_STUB: ${{ steps.install-ahk.outputs.ahk-path }} | ||
AHK2EXE: ${{ steps.install-ahk.outputs.ahk2exe-path }} | ||
VERSION: ${{ inputs.version }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: mwm | ||
path: | | ||
build/mwm.exe | ||
build/mwm.ahk | ||
- name: Tag commit | ||
shell: bash | ||
run: | | ||
git tag $VERSION | ||
git push origin $VERSION | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
|
||
publish: | ||
runs-on: windows-latest | ||
needs: build | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: mwm | ||
|
||
- name: Zip artifact | ||
shell: pwsh | ||
run: | | ||
Compress-Archive ` | ||
-Path mwm.exe, mwm.ahk ` | ||
-DestinationPath mwm-$env:VERSION.zip | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
generate_release_notes: true | ||
tag_name: ${{ inputs.version }} | ||
files: | | ||
mwm-*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters