Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed May 20, 2024
1 parent cda16c5 commit 5014b18
Show file tree
Hide file tree
Showing 23 changed files with 12,188 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/main-0.1.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: PuPuSharp

run-name: 0.1.0.${{ github.run_number }}

on:
workflow_dispatch:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- master

env:
_IS_BUILD_CANARY: false
_IS_GITHUB_RELEASE: false
_RELEASE_NAME: PuPuSharp
_RELEASE_VERSION: v0
_RELEASE_CONFIGURATION: Release
_BUILD_BRANCH: "${{ github.ref }}"
_BUILD_VERSION: "0.1.0.${{ github.run_number }}"
# GIT: Fix reporting from stderr to stdout
GIT_REDIRECT_STDERR: 2>&1

jobs:
PuPuSharp:
runs-on: windows-latest
timeout-minutes: 1440
strategy:
max-parallel: 1
steps:
- name: Set Git Config
run: |
git config --global core.autocrlf false
git config --global core.filemode false
git config --global core.longpaths true
- name: Checkout
uses: actions/checkout@v4.1.0
- name: Prepare Environment
run: ".github/workflows/prepare.ps1"
shell: pwsh
- name: Update project version
uses: roryprimrose/set-vs-sdk-project-version@v1
with:
version: "${{ env._BUILD_VERSION }}"
assemblyVersion: "${{ env._BUILD_VERSION }}"
fileVersion: "${{ env._BUILD_VERSION }}"
informationalVersion: "${{ env._BUILD_VERSION }}"
- name: Restore NuGet Packages
run: nuget restore ${{ github.workspace }}\src\${{ env._RELEASE_NAME }}.sln
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.3.2
- name: Run MSBuild
run: msbuild ${{ github.workspace }}\src\${{ env._RELEASE_NAME }}.sln /p:WindowsTargetPlatformVersion=10.0.19041.0 /m -p:Configuration=${{ env._RELEASE_CONFIGURATION }} -p:Platform="Any CPU"
- name: Package the release
run: ".github/workflows/package.ps1"
shell: pwsh
- name: Publish PR artifacts
if: env._IS_GITHUB_RELEASE == 'false' && success()
uses: actions/upload-artifact@v4.0.0
with:
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
path: ".dist/*.zip"
- name: Publish Canary release
uses: ncipollo/release-action@v1
if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'true' && success()
with:
artifacts: ".dist/*.zip"
allowUpdates: true
generateReleaseNotes: true
prerelease: true
removeArtifacts: true
tag: canary
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
body: |
This is a canary build. Please be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!
- name: Publish Stable release
uses: ncipollo/release-action@v1
if: env._IS_GITHUB_RELEASE == 'true' && env._IS_BUILD_CANARY == 'false' && success()
with:
artifacts: ".dist/*.zip"
generateReleaseNotes: true
makeLatest: true
removeArtifacts: true
name: "${{ env._RELEASE_NAME }}-${{ env._RELEASE_VERSION }}"
3 changes: 3 additions & 0 deletions .github/workflows/package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdir .dist | Out-Null

7z a ".\.dist\${env:_RELEASE_NAME}-${env:_RELEASE_VERSION}_${env:_RELEASE_CONFIGURATION}.zip" ".\src\bin\Release\net8.0-windows7.0\*"
19 changes: 19 additions & 0 deletions .github/workflows/prepare.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if ($env:_BUILD_BRANCH -eq "refs/heads/master" -Or $env:_BUILD_BRANCH -eq "refs/tags/canary") {
$env:_IS_BUILD_CANARY = "true"
$env:_IS_GITHUB_RELEASE = "true"
}
elseif ($env:_BUILD_BRANCH -like "refs/tags/*") {
$env:_BUILD_VERSION = $env:_BUILD_VERSION.Substring(0, $env:_BUILD_VERSION.LastIndexOf('.')) + ".0"
$env:_IS_GITHUB_RELEASE = "true"
}
$env:_RELEASE_VERSION = "v${env:_BUILD_VERSION}"

Write-Output "--------------------------------------------------"
Write-Output "BUILD CONFIGURATION: $env:_RELEASE_CONFIGURATION"
Write-Output "RELEASE VERSION: $env:_RELEASE_VERSION"
Write-Output "--------------------------------------------------"

Write-Output "_BUILD_VERSION=${env:_BUILD_VERSION}" >> ${env:GITHUB_ENV}
Write-Output "_RELEASE_VERSION=${env:_RELEASE_VERSION}" >> ${env:GITHUB_ENV}
Write-Output "_IS_BUILD_CANARY=${env:_IS_BUILD_CANARY}" >> ${env:GITHUB_ENV}
Write-Output "_IS_GITHUB_RELEASE=${env:_IS_GITHUB_RELEASE}" >> ${env:GITHUB_ENV}
Loading

0 comments on commit 5014b18

Please sign in to comment.