Update KompleteKontrol.ahk #824
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
on: | |
push: {} | |
pull_request: {} | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Write build number | |
uses: DamianReeves/write-file-action@master | |
with: | |
path: Includes/CIVersion.ahk | |
write-mode: overwrite | |
contents: | | |
BuildNumber := "${{ github.run_number }}" | |
- name: Replace version | |
if: startsWith(github.ref, 'refs/tags') && !github.event_type != 'pull_request' | |
uses: Nambers/[email protected] | |
with: | |
oldString: '^Version\s:=\s\".*\"' | |
newString: 'Version := \"${{ github.ref_name }}\"' | |
showFileContent: true | |
path: ${{ github.workspace }}/Includes/Version.ahk | |
- name: Build with AHK v2.0.18 | |
uses: Timtam/autohotkey-build@master | |
with: | |
version: v2.0.18 | |
x64: true | |
x86: true | |
compression: none | |
out: "build" | |
- name: Convert Markdown to HTML | |
uses: natescherer/[email protected] | |
with: | |
path: README.md | |
outputpath: build | |
- | |
name: "Prepare artifact" | |
run: | | |
xcopy Images build\Images /I /S | |
xcopy Sounds build\Sounds /I | |
xcopy bassasio32.dll build | |
xcopy bassasio64.dll build | |
xcopy nvdaControllerClient32.dll build | |
xcopy nvdaControllerClient64.dll build | |
- | |
name: "Upload artifact" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "ReaHotkey" | |
path: build/ | |
github_release: | |
needs: ["build"] | |
if: startsWith(github.ref, 'refs/tags') && !github.event_type != 'pull_request' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
checks: write | |
actions: read | |
issues: read | |
packages: write | |
pull-requests: read | |
repository-projects: read | |
statuses: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
- name: Download Build | |
uses: actions/download-artifact@v3 | |
with: | |
name: "ReaHotkey" | |
path: ~/build/ReaHotkey | |
- name: Zip Release | |
run: | | |
cd ~/build | |
zip -r ReaHotkey-${{ github.ref_name }}-${{ github.run_number }}.zip ReaHotkey | |
# get it out of the way so that the uploads don't freak out. | |
rm -rf ReaHotkey | |
- name: Update changelog | |
uses: thomaseizinger/[email protected] | |
with: | |
version: ${{ github.ref_name }} | |
- name: Replace version | |
uses: Nambers/[email protected] | |
with: | |
oldString: '^Version\s:=\s\".*\"' | |
newString: 'Version := \"${{ github.ref_name }}\"' | |
showFileContent: true | |
path: ${{ github.workspace }}/Includes/Version.ahk | |
# In order to make a commit, we need to initialize a user. | |
# You may choose to write something less generic here if you want, it doesn't matter functionality wise. | |
- name: Initialize mandatory git config | |
run: | | |
git config user.name "GitHub actions" | |
git config user.email [email protected] | |
- name: Commit changelog | |
run: | | |
git add CHANGELOG.md Includes/Version.ahk | |
git commit --message "Prepare release ${{ github.ref_name }}" | |
git push | |
- name: Parse changelog | |
id: changelog | |
run: | | |
chmod +x ./Scripts/parse-changelog.sh | |
echo 'CHANGELOG<<EOF' >> $GITHUB_OUTPUT | |
./Scripts/parse-changelog.sh ${{ github.ref_name }} CHANGELOG.md >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref_name }}-${{ github.run_number }} | |
body: ${{ steps.changelog.outputs.CHANGELOG }} | |
- name: Upload Artifacts | |
uses: alexellis/[email protected] | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
asset_paths: '[ "/home/runner/build/ReaHotkey-${{ github.ref_name }}-${{ github.run_number }}.zip" ]' |