initial commit
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
name: Pulsar .NET 9.0 Windows Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
repository-projects: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup .NET 9.0
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Get Version
|
||||
run: |
|
||||
$version = (Get-Content Pulsar.Server/Utilities/ServerVersion.cs | Select-String 'Current = "([^"]+)"').Matches.Groups[1].Value
|
||||
echo "VERSION=$version" >> $env:GITHUB_ENV
|
||||
shell: pwsh
|
||||
|
||||
- name: Restore Dependencies
|
||||
run: dotnet restore Pulsar.sln
|
||||
|
||||
- name: Build Solution
|
||||
run: msbuild Pulsar.sln /p:Configuration=Release /p:Platform=AnyCPU
|
||||
|
||||
- name: Prepare Build Output
|
||||
run: |
|
||||
if (Test-Path "./bin/Release/net9.0-windows") {
|
||||
Compress-Archive -Path "./bin/Release/net9.0-windows/*" -DestinationPath "pulsar-net-win64-${{ env.VERSION }}.zip"
|
||||
Write-Host "Zipped net9.0-windows output"
|
||||
} else {
|
||||
Write-Host "Error: net9.0-windows output not found"
|
||||
exit 1
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-build-${{ env.VERSION }}
|
||||
path: pulsar-net-win64-${{ env.VERSION }}.zip
|
||||
|
||||
- name: Delete existing release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release delete Pulsar-v${{ env.VERSION }} --yes --cleanup-tag || echo "No existing release/tag to delete"
|
||||
shell: bash
|
||||
|
||||
- name: Create Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release create Pulsar-v${{ env.VERSION }} pulsar-net-win64-${{ env.VERSION }}.zip \
|
||||
-t "Pulsar-v${{ env.VERSION }}" \
|
||||
-n "Automated build release for Pulsar v${{ env.VERSION }}" \
|
||||
--draft=false \
|
||||
--prerelease=false
|
||||
shell: bash
|
||||
@@ -0,0 +1,31 @@
|
||||
name: Mirror to Codeberg and Gitea
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["*"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
mirror:
|
||||
runs-on: ubuntu:22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # all history fr
|
||||
|
||||
- name: Mirror to Codeberg and Gitea
|
||||
env:
|
||||
CODEBERG_USERNAME: ${{ secrets.CODEBERG_USERNAME }}
|
||||
CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
|
||||
GITEA_USERNAME: ${{ secrets.GITEA_USERNAME }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
git config --global user.name "GitHub Mirror Bot"
|
||||
git config --global user.email "[email protected]"
|
||||
|
||||
git remote add codeberg https://$CODEBERG_USERNAME:[email protected]/$CODEBERG_USERNAME/Poopsar.git
|
||||
git remote add gitea https://$GITEA_USERNAME:[email protected]/$GITEA_USERNAME/Poopsar.git
|
||||
|
||||
git push --mirror codeberg
|
||||
git push --mirror gitea
|
||||
Reference in New Issue
Block a user