forked from pascalabcnet/pascalabcnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upstream sync & nightly build bot
+ experimental build & test on Linux
- Loading branch information
1 parent
cd53ec3
commit 2311a03
Showing
7 changed files
with
179 additions
and
146 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build / Test on Ubuntu [manual] | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: sh | ||
|
||
jobs: | ||
build: | ||
|
||
name: Prepare and build on Ubuntu | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build project in Release-mode / compile Pas-units / run tests | ||
run: ./_RebuildReleaseAndRunTests.sh | ||
timeout-minutes: 40 | ||
env: | ||
PABCNET_BUILD_MODE: Release | ||
PABCNET_RUN_TESTS: false | ||
PABCNET_INC_BUILD: false | ||
PABCNET_VERBOSE: false | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
name: Pull upstream / Make a nightly release on Windows [manual + cron] | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
defaults: | ||
run: | ||
shell: cmd | ||
|
||
jobs: | ||
build: | ||
|
||
name: Prepare and build on Windows Server 2019 VM | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Pull changes from original repo | ||
run: | | ||
git config --global user.name "BH build bot" | ||
git config --global user.email "SpectatorBH@outlook.com" | ||
|
||
git pull https://github.com/pascalabcnet/pascalabcnet.git master | ||
git push | ||
|
||
- name: Install dependencies into Virtual Environment | ||
run: _RegisterHelixNUnit.bat | ||
|
||
- name: Build C# project in Release-mode / compile Pas-units / run tests | ||
run: _GenerateAllSetupsForGitHubActions.bat | ||
timeout-minutes: 40 | ||
env: | ||
PABCNET_BUILD_MODE: Release | ||
PABCNET_RUN_TESTS: false | ||
PABCNET_INC_BUILD: false | ||
PABCNET_VERBOSE: false | ||
|
||
- name: Prepare GitHub scripting module | ||
run: npm install @actions/exec | ||
|
||
- name: Create GitHub Release | ||
uses: actions/github-script@main | ||
with: | ||
script: | | ||
const tag = "nightly-release-tag"; // Git tag name (preferably different from branch name) | ||
const release_name = "Nightly build (upstream synced)"; // GitHub release display name | ||
const mark_pre_release = true; | ||
console.log('environment', process.versions); | ||
sha = ''; | ||
await require('@actions/exec').exec('git', ['rev-parse', 'HEAD'], { | ||
listeners: { | ||
stdout: data => { | ||
sha += data.toString().trim(); | ||
}, | ||
stderr: data => { | ||
sha += data.toString().trim(); | ||
} | ||
} | ||
}); | ||
const { repo: { owner, repo } } = context; | ||
console.log({ owner, repo, sha }); | ||
// Check if the release already exists | ||
const existingReleases = await github.rest.repos.listReleases({ owner, repo }); | ||
for (const existingRelease of existingReleases.data) { | ||
if (existingRelease.tag_name === tag) { | ||
console.log('deleing old release', { existingRelease }); | ||
await github.rest.repos.deleteRelease({ | ||
owner, | ||
repo, | ||
release_id: existingRelease.id, | ||
}); | ||
break; | ||
} | ||
} | ||
try { | ||
await github.rest.git.deleteRef({ | ||
owner: owner, | ||
repo: repo, | ||
ref: `tags/${tag}` | ||
}); | ||
console.log('Tag deleted successfully'); | ||
} catch (error) { | ||
console.error(`Error deleting tag: ${error}`); | ||
} | ||
const release = await github.rest.repos.createRelease({ | ||
owner, repo, | ||
tag_name: tag, | ||
name: release_name, | ||
draft: true, | ||
prerelease: mark_pre_release, | ||
target_commitish: sha | ||
}); | ||
console.log('created release', { release }); | ||
const fs = require('fs').promises; | ||
for (let file of await fs.readdir('Release')) { | ||
console.log('uploading', file); | ||
if (file.startsWith('.')) continue; | ||
try { | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner, repo, | ||
release_id: release.data.id, | ||
name: file, | ||
data: await fs.readFile(`./Release/${file}`) | ||
}); | ||
} catch (error) { | ||
console.error(`Error uploading: ${error}`); | ||
} | ||
} | ||
if (release.data.draft) { | ||
console.log('finalizing draft release'); | ||
await github.rest.repos.updateRelease({ | ||
owner, | ||
repo, | ||
release_id: release.data.id, | ||
draft: false, | ||
}); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"dotnet.preferCSharpExtension": true | ||
"dotnet.preferCSharpExtension": true, | ||
"dotnet.defaultSolution": "disable" | ||
} |