Update to ASP.NET Core 8 #2035
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
name: build | |
on: | |
push: | |
branches: [ main ] | |
tags: [ v* ] | |
paths-ignore: | |
- '**/*.md' | |
- '**/*.gitignore' | |
- '**/*.gitattributes' | |
pull_request: | |
branches: [ main, dotnet-vnext ] | |
workflow_dispatch: | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
DOTNET_MULTILEVEL_LOOKUP: 0 | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1 | |
FORCE_COLOR: 1 | |
MACOS_APP_NAME: AppleFitnessWorkoutMapper.app | |
MACOS_APP_PATH: ./artifacts/AppleFitnessWorkoutMapper.app | |
MACOS_ARTIFACTS_PATH: ./artifacts | |
NUGET_XMLDOC_MODE: skip | |
TERM: xterm | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ macos-latest, ubuntu-latest, windows-latest ] | |
include: | |
- os: macos-latest | |
codecov_os: macos | |
- os: ubuntu-latest | |
codecov_os: linux | |
- os: windows-latest | |
codecov_os: windows | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 | |
- name: Build, test and publish | |
shell: pwsh | |
run: ./build.ps1 | |
env: | |
GoogleMapsApiKey: ${{ secrets.GOOGLE_MAPS_API_KEY }} | |
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 | |
name: Upload coverage to Codecov | |
with: | |
files: ./artifacts/coverage.cobertura.xml,./src/AppleFitnessWorkoutMapper/coverage/lcov.info | |
flags: ${{ matrix.codecov_os }} | |
- name: Publish ZIP artifacts | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: ${{ runner.os == 'Linux' }} | |
with: | |
name: app-zips | |
path: ./artifacts/publish/AppleFitnessWorkoutMapper/*.zip | |
- name: Publish macOS artifacts | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: ${{ runner.os == 'Linux' }} | |
with: | |
name: app-macos | |
path: ./artifacts/publish/AppleFitnessWorkoutMapper/release_osx-x64 | |
if-no-files-found: error | |
- name: Publish screenshots | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: ${{ always() }} | |
with: | |
name: screenshots | |
path: ./artifacts/screenshots/*.png | |
if-no-files-found: ignore | |
- name: Publish traces | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: ${{ always() }} | |
with: | |
name: traces | |
path: ./artifacts/traces/* | |
if-no-files-found: ignore | |
- name: Publish videos | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: ${{ always() }} | |
with: | |
name: videos | |
path: ./artifacts/videos/* | |
if-no-files-found: ignore | |
notarize: | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
name: notarize | |
needs: build | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Download artifacts | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: app-macos | |
path: ${{ env.MACOS_ARTIFACTS_PATH }}/publish | |
- name: Generate macOS app | |
shell: pwsh | |
run: | | |
$Artifacts = "${{ env.MACOS_ARTIFACTS_PATH }}" | |
$AppName = "${{ env.MACOS_APP_NAME }}" | |
$AppPath = "${{ env.MACOS_APP_PATH }}" | |
$ContentsPath = (Join-Path ${AppPath} "Contents") | |
$PublishPath = (Join-Path ${Artifacts} "publish") | |
New-Item -Path ${Artifacts} -Name ${AppName} -ItemType "Directory" | Out-Null | |
New-Item -Path ${AppPath} -Name "Contents" -ItemType "Directory" | Out-Null | |
New-Item -Path ${ContentsPath} -Name "Resources" -ItemType "Directory" | Out-Null | |
Copy-Item -Path ${PublishPath} -Destination (Join-Path ${ContentsPath} "MacOS") -Recurse | Out-Null | |
Copy-Item -Path ./src/AppleFitnessWorkoutMapper/Info.plist -Destination ${ContentsPath} | Out-Null | |
- name: Configure Xcode | |
uses: devbotsxyz/xcode-select@05f94658217eb8575f0aabd3b95e702a47995d21 # v1.1.0 | |
with: | |
version: "12.4" | |
- name: Import Distribution Certificate | |
uses: devbotsxyz/import-signing-certificate@ab25a47abdb4f12b687fa4ea05d42942fe62961e # v1.0.0 | |
with: | |
certificate-data: ${{ secrets.DISTRIBUTION_CERTIFICATE_DATA }} | |
certificate-passphrase: ${{ secrets.DISTRIBUTION_CERTIFICATE_PASSPHRASE }} | |
keychain-name: '' | |
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }} | |
- name: Sign app | |
shell: bash | |
env: | |
APP_PATH: ${{ env.MACOS_APP_PATH }} | |
ENTITLEMENTS: ./src/AppleFitnessWorkoutMapper/AppleFitnessWorkoutMapper.entitlements | |
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} | |
run: | | |
chmod +x $APP_PATH/Contents/MacOS/AppleFitnessWorkoutMapper | |
find "$APP_PATH/Contents/MacOS/"|while read fname; do | |
if [[ -f $fname ]]; then | |
echo "Signing $fname" | |
codesign --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$fname" || true | |
fi | |
done | |
echo "Signing app file" | |
codesign --force --timestamp --options=runtime --entitlements "$ENTITLEMENTS" --sign "$SIGNING_IDENTITY" "$APP_PATH" | |
- name: Notarize app | |
uses: devbotsxyz/xcode-notarize@d7219e1c390b47db8bab0f6b4fc1e3b7943e4b3b # v1.0.0 | |
with: | |
primary-bundle-id: com.martincostello.applefitnessworkoutmapper | |
product-path: ${{ env.MACOS_APP_PATH }} | |
appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }} | |
appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} | |
- name: Staple app | |
uses: devbotsxyz/xcode-staple@ae68b22ca35d15864b7f7923e1a166533b2944bf # v1.0.0 | |
with: | |
product-path: ${{ env.MACOS_APP_PATH }} | |
- name: Package signed app | |
run: ditto -V -c -k --keepParent ${{ env.MACOS_APP_PATH }} ./artifacts/AppleFitnessWorkoutMapper-osx-x64.zip | |
- name: Publish signed app | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
with: | |
name: app-macos-signed | |
path: ./artifacts/AppleFitnessWorkoutMapper-osx-x64.zip | |
- name: Update macOS ZIP artifact | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
with: | |
name: app-zips | |
path: ./artifacts/AppleFitnessWorkoutMapper-osx-x64.zip | |
release: | |
name: release | |
needs: notarize | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: app-zips | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 | |
with: | |
draft: true | |
files: '*.zip' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |