mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 14:45:52 -06:00
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Update Branch
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- test*
|
|
|
|
jobs:
|
|
build-runspace:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
- name: Compile project
|
|
shell: pwsh
|
|
run: |
|
|
Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1
|
|
continue-on-error: false # Directly fail the job on error, removing the need for a separate check
|
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
with:
|
|
commit_message: Compile Winutil
|
|
if: success()
|
|
|
|
create-release:
|
|
needs: build-runspace
|
|
runs-on: windows-latest
|
|
if: github.ref == 'refs/heads/main'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Prepare Release Date
|
|
run: |
|
|
$date = (Get-Date).AddDays(1).ToString('yyyy-MM-dd')
|
|
echo "CURRENT_DATE=$date" >> $GITHUB_ENV
|
|
shell: pwsh
|
|
- name: Set Git Config
|
|
run: |
|
|
git config --local user.email "contact@christitus.com"
|
|
git config --local user.name "Chris Titus"
|
|
- name: Create and Push Tag
|
|
run: |
|
|
git tag ${{ env.CURRENT_DATE }}
|
|
git push origin ${{ env.CURRENT_DATE }}
|
|
- name: Create Release and Upload Asset
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ env.CURRENT_DATE }}
|
|
name: Release ${{ env.CURRENT_DATE }}
|
|
draft: false
|
|
prerelease: false
|
|
files: ./winutil.ps1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |