Skip to content

More tweaking release logic #8

More tweaking release logic

More tweaking release logic #8

name: Build and Release
on: push
# push:
# branches: [ "main", "master" ]
jobs:
call_check_version:
uses: ./.github/workflows/check_version.yml
build_and_release:
runs-on: windows-latest
needs: call_check_version
if: always() && (needs.call_check_version.result == 'success')
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
5.0.x
6.0.x
7.0.x
- name: Restore dependencies
run: dotnet restore
## Might as well build and test since we're here
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
## This lets us build the electron app
- name: Install ElectronNET.CLI
run: dotnet tool install ElectronNET.CLI -g
- name: Build Release Artifact
run: |

Check failure on line 43 in .github/workflows/build_and_release.yml

View workflow run for this annotation

GitHub Actions / Build and Release

Invalid workflow file

The workflow is not valid. .github/workflows/build_and_release.yml (Line: 43, Col: 12): Unrecognized named-value: 'jobs'. Located at position 1 within expression: jobs.check_version.outputs.version .github/workflows/build_and_release.yml (Line: 52, Col: 17): Unrecognized named-value: 'jobs'. Located at position 1 within expression: jobs.check_version.outputs.version
cd GUI
electronize build /target win
echo "releaseArtifactPath='D:\a\deep-rock-galactic-save-syncer\deep-rock-galactic-save-syncer\GUI\bin\Desktop\DRG Save Syncer Setup ${{ jobs.check_version.outputs.version }}.exe"' >> "$GITHUB_OUTPUT"
- name: Create Draft Release
id: create_release
uses: actions/github-script@v7
with:
script: |
const { data: release } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: 'v${{ jobs.check_version.outputs.version }}',
name: 'Deep Rock Galactic Save Syncer v${{ jobs.check_version.outputs.version }}',
draft: true,
generate_release_notes: true
});
echo "releaseId=${release.id}" >> "$GITHUB_OUTPUT"
- name: Upload Release Artifact
id: upload_release_artifact
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const { data: releaseAsset } = await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ steps.create_release.outputs.releaseId }},
name: 'DeepRockGalacticSaveSyncer-v${{ jobs.check_version.outputs.version }}.exe',
data: fs.readFileSync(${{ steps.create_release.outputs.releaseArtifactPath }})
});