Skip to content

Commit

Permalink
Debug CI
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed Jun 30, 2024
1 parent 160f737 commit 7eab527
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 437 deletions.
28 changes: 28 additions & 0 deletions .github/actions/package/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Configure manifest
inputs:
manifest:
required: true
publisher:
required: true
version:
required: true
prefix:
required: true
branch:
required: true
runs:
using: "composite"
steps:
- name: Configure manifest
shell: powershell
run: |
$manifestPath = ${{ inputs.manifest }}
$manifest = [xml](Get-Content $manifestPath)
$manifest.Package.Identity.Publisher = "${{ inputs.publisher }}"
$manifest.Package.Identity.Version = "${{ inputs.version }}"
$manifest.Package.Properties.DisplayName = "${{ inputs.prefix }}"
if ("${{ inputs.branch }}" -ne "master") {
$manifest.Package.Properties.DisplayName = $manifest.Package.Properties.DisplayName + " (${{ inputs.branch }})"
}
$manifest.Save($manifestPath)
File renamed without changes.
File renamed without changes.
72 changes: 72 additions & 0 deletions .github/workflows/10-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Base
on:
push:
branches:
- master
- dev
- rafael/*
paths-ignore:
- '**/*.md'
- '.github/ISSUE_TEMPLATE/*'
- '.github/workflows/sponsors.yml'
- '.github/workflows/translators.yml'
- 'Graphics/*'
pull_request:
branches:
- dev
paths-ignore:
- '**/*.md'
- crowdin.yml
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
base:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
includePrerelease: false

- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]

- name: Create artifacts folder
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path .artifacts/
- name: Generate versioning artifact
shell: pwsh
run: |
"${{ steps.gitversion.outputs.majorMinorPatch }}.${{ steps.gitversion.outputs.commitsSinceVersionSource }}" |
Out-File .artifacts/version.txt
- name: Restore packages
run: dotnet restore EarTrumpet.sln
shell: cmd

- name: Build EarTrumpet
shell: cmd
run: |
dotnet publish /p:PublishProfile=Properties\PublishProfiles\x86.pubxml EarTrumpet/EarTrumpet.csproj /p:Platform=x86 /p:OutputPath=..\.artifacts\base\x86
dotnet publish /p:PublishProfile=Properties\PublishProfiles\x64.pubxml EarTrumpet/EarTrumpet.csproj /p:Platform=x64 /p:OutputPath=..\.artifacts\base\x64
dotnet publish /p:PublishProfile=Properties\PublishProfiles\arm64.pubxml EarTrumpet/EarTrumpet.csproj /p:Platform=ARM64 /p:OutputPath=..\.artifacts\base\arm64
- name: Add to cache
uses: actions/cache/save@v4
with:
key: base-${{ github.sha }}
path: |
.artifacts
40 changes: 40 additions & 0 deletions .github/workflows/20-appinstaller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
workflow_run:
workflows: ["Base"]
types:
- completed

env:
channel: "AppInstaller"
publisher: "CN=File-New-Project, O=File-New-Project, L=Purcellville, S=Virginia, C=US"

jobs:
appinstaller:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Restore base
uses: actions/cache/restore@v4
with:
path: .artifacts
key: base-${{ github.sha }}

- name: Set Bugsnag API Key
shell: pwsh
run: |
Get-ChildItem .artifacts\base\**\app.config | ForEach-Object {
$cfg = Get-Content $_
$cfg | ForEach-Object { $_.Replace("{bugsnag.apikey}", "${{ secrets.bugsnag_api_key }}") } | Set-Content $_
}
- name: Configure manifest
uses: .github/actions/package/manifest.yml
with:
manifest: packaging/package.appxmanifest
publisher: ${{ env.publisher }}
branch: ${{ github.ref_name }}
prefix: "EarTrumpet"
version: .artifacts/version.txt
Loading

0 comments on commit 7eab527

Please sign in to comment.