Aktualisieren von build-nightly.yml #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}-g${{ github.sha }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: build-windows | |
name: Publish release | |
steps: | |
- name: Move tag | |
if: ${{ github.event_name == 'push'}} | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
script: | | |
github.rest.git.updateRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "tags/Nightly", | |
sha: context.sha | |
}) | |
- name: Create Release | |
if: ${{ github.event_name == 'push'}} | |
uses: ncipollo/release-action@v1.14.0 | |
with: | |
name: Latest Nightly build | |
tag: Nightly | |
prerelease: true | |
allowUpdates: true | |
removeArtifacts: true | |
generateReleaseNotes: 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 | |