-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.46 KB
/
build-and-release.yaml
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
52
name: Build and Release
on:
push:
branches:
- main # or the branch you want to trigger the workflow on
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- name: Install MinGW and GCC
run: |
choco install mingw -y
- name: Build executable
run: |
g++ -o YTCompression.exe src/YTCompression.cpp
- name: Get version number
id: get_version
run: |
$VERSION = Get-Content src/version.txt
Write-Output "VERSION=$VERSION" | Out-File -Append -FilePath $env:GITHUB_ENV
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
body: 'Release of version ${{ env.VERSION }}'
- name: 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: ./YTCompression.exe
asset_name: YTCompression.exe
asset_content_type: application/octet-stream