Build AHK v2 Script #2
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
name: Build AHK v2 Script | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Download AutoHotkey v2 | |
run: | | |
Invoke-WebRequest -Uri "https://www.autohotkey.com/download/2.0/AutoHotkey_2.0-beta.1.zip" -OutFile "AutoHotkey.zip" | |
Expand-Archive -Path "AutoHotkey.zip" -DestinationPath "AutoHotkey" | |
- name: Build AHK Script | |
run: | | |
.\AutoHotkey\AutoHotkey64.exe main.ahk | |
- name: Create Release | |
id: release | |
uses: actions/create-release@v1 | |
env: | |
APP_VERSION: ${{ steps.app_version.outputs.tag }} | |
GITHUB_TOKEN: ${{ secrets.PAT }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ env.APP_VERSION }} | |
release_name: Release ${{ env.APP_VERSION }} | |
draft: false | |
prerelease: false | |
- name: Set tag env | |
id: app_version | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Set app version from tag | |
env: | |
APP_VERSION: ${{ steps.app_version.outputs.tag }} | |
run: | | |
echo ${{ env.APP_VERSION }} | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, this is why it needs the id | |
asset_path: main.exe | |
asset_name: main.exe | |
asset_content_type: text/plain |