Skip to content

Update build-and-release.yaml #6

Update build-and-release.yaml

Update build-and-release.yaml #6

name: Build and Release
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout code
uses: actions/checkout@v3
- 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: alice-biometrics/release-creator@v1.0.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.VERSION }}
branch: main
description: '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