mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-03-29 08:55:02 +02:00
Automatically generate pre-releases on push to main
This commit is contained in:
parent
fbd7ce2db4
commit
1f48f4a761
50
.github/workflows/build.yaml
vendored
50
.github/workflows/build.yaml
vendored
|
|
@ -1,45 +1,17 @@
|
|||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
release:
|
||||
types: [published]
|
||||
paths-ignore:
|
||||
- '**/**.md'
|
||||
|
||||
env:
|
||||
DOTNET_VERSION: '6.0.x'
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.ref_type != 'tag'
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build without Version
|
||||
run: dotnet build --configuration Release --output FanControl-develop/
|
||||
- name: Test
|
||||
run: dotnet test --no-restore --verbosity normal
|
||||
- uses: vimtor/action-zip@v1
|
||||
with:
|
||||
files: FanControl-develop/
|
||||
dest: FanControl-develop.zip
|
||||
|
||||
build-and-release:
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: github.ref_type == 'tag'
|
||||
runs-on: windows-latest
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup .NET
|
||||
|
|
@ -48,19 +20,21 @@ jobs:
|
|||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build with Version
|
||||
run: dotnet build --configuration Release /property:Version=${{ github.event.release.tag_name }} --output FanControl-${{ github.event.release.tag_name }}/
|
||||
- name: Set RELEASE_VERSION
|
||||
run: echo "RELEASE_VERSION=$(cat VERSION).$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release --output "FanControl-${{ env.RELEASE_VERSION }}/" "/property:Version=${{ env.RELEASE_VERSION }}"
|
||||
- name: Test
|
||||
run: dotnet test --no-restore --verbosity normal
|
||||
- uses: vimtor/action-zip@v1
|
||||
with:
|
||||
files: FanControl-${{ github.event.release.tag_name }}
|
||||
dest: FanControl-${{ github.event.release.tag_name }}.zip
|
||||
files: FanControl-${{ env.RELEASE_VERSION }}
|
||||
dest: FanControl-${{ env.RELEASE_VERSION }}.zip
|
||||
recursive: true
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ env.RELEASE_VERSION }}
|
||||
artifacts: "*.zip"
|
||||
prerelease: true
|
||||
allowUpdates: true
|
||||
generateReleaseNotes: true
|
||||
omitNameDuringUpdate: true
|
||||
updateOnlyUnreleased: true
|
||||
|
|
|
|||
26
.github/workflows/pull_request.yaml
vendored
Normal file
26
.github/workflows/pull_request.yaml
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
DOTNET_VERSION: '6.0.x'
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build without Version
|
||||
run: dotnet build --configuration Release --output FanControl-develop/
|
||||
- name: Test
|
||||
run: dotnet test --no-restore --verbosity normal
|
||||
- uses: vimtor/action-zip@v1
|
||||
with:
|
||||
files: FanControl-develop
|
||||
dest: FanControl-develop.zip
|
||||
recursive: true
|
||||
Loading…
Reference in a new issue