Aktualisieren von build-nightly.yml #72
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: Create Release | ||
if: ${{ github.event_name == 'push'}} | ||
uses: ncipollo/[email protected] | ||
with: | ||
name: Latest Nightly build | ||
tag: Nightly | ||
prerelease: true | ||
allowUpdates: true | ||
- name: Move tag | ||
if: ${{ github.event_name == 'push'}} | ||
uses: actions/github-script@v7 | ||
with: | ||
result-encoding: string | ||
script: | | ||
Check failure on line 56 in .github/workflows/build-nightly.yml GitHub Actions / Nightly buildInvalid workflow file
|
||
github.rest.git.createTag({ | ||
${{context.repo.owner}}, | ||
${{context.repo.repo}}, | ||
"Nightly", | ||
"", | ||
${{ github.sha }}, | ||
}) | ||
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 | ||