Skip to content

Aktualisieren von build-nightly.yml #77

Aktualisieren von build-nightly.yml

Aktualisieren von build-nightly.yml #77

Workflow file for this run

name: Nightly build
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
prepare-build:
name: Prepare build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.previous-tag.outputs.tag }}-g${{ steps.shorten-sha.outputs.sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
README.md
- name: Get previous tag
id: previous-tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.0.0
- name: Shorten sha
id: shorten-sha
run: |
sha=$(echo ${{ github.sha }} | cut -c 1-7) >> $GITHUB_OUTPUT
build-windows:
name: Build Windows
needs: prepare-build
uses: ./.github/workflows/dotnet-desktop.yml
with:
version: ${{ needs.prepare-build.outputs.version }}
publish:
runs-on: ubuntu-latest
needs: build-windows
name: Publish release
steps:
- name: Remove old nightly
uses: dev-drprasad/[email protected]
with:
tag_name: Nightly
delete_release: true
- name: Create Release
if: ${{ github.event_name == 'push'}}
uses: softprops/action-gh-release@v2
with:
name: Latest Nightly build
tag_name: Nightly
target_commitish: ${{ github.sha }}
prerelease: true
generate_release_notes: true
attach-artifacts:
name: Attach artifacts
needs: [build-windows, publish]
strategy:
matrix:
build:
- label: "Windows_x86"
artifact-name: ${{needs.build-windows.outputs.x86}}
- label: "Windows_x64"
artifact-name: ${{needs.build-windows.outputs.x64}}
runs-on: ubuntu-latest
steps:
- name: Download artifact
id: download-artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.build.artifact-name }}
- name: Zip files
run: |
cd ${{ steps.download-artifact.outputs.download-path }}
7z a '../${{ matrix.build.artifact-name }}.zip'
- name: Attach to release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.download-artifact.outputs.download-path }}/../${{ matrix.build.artifact-name }}.zip
tag_name: Nightly