-
-
Notifications
You must be signed in to change notification settings - Fork 107
51 lines (49 loc) · 1.76 KB
/
build_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
on: [push, pull_request]
name: Build test
jobs:
build:
name: Build test
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Install AutoHotkey with Chocolatey
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install autohotkey
# fix for [Unable to copy error by command line · Issue #68 · AutoHotkey/Ahk2Exe](https://github.com/AutoHotkey/Ahk2Exe/issues/68)
- name: build
shell: cmd
run: ./build.bat
- name: get tag
if: startsWith( github.ref, 'refs/tags/v' )
id: get_tag
shell: bash
run: echo ::set-output name=tag::${GITHUB_REF##*/}
- name: zip
if: startsWith( github.ref, 'refs/tags/v' )
shell: pwsh
run:
Compress-Archive -Path "vim_ahk" -DestinationPath vim_ahk-${{steps.get_tag.outputs.tag}}.zip
- name: Create Release
if: startsWith( github.ref, 'refs/tags/v' )
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{github.ref}}
release_name: Release ${{github.ref}}
draft: false
prerelease: false
- name: Upload Release Asset
if: startsWith( github.ref, 'refs/tags/v' )
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: vim_ahk-${{steps.get_tag.outputs.tag}}.zip
asset_name: vim_ahk-${{steps.get_tag.outputs.tag}}.zip
asset_content_type: application/zip