AttachDevTools (#260) #345
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' ] | |
paths-ignore: [ 'docs/**' ] | |
permissions: write-all | |
env: | |
CONFIG: Release | |
SLN_FILE: Fabulous.Avalonia.NoSamples.sln | |
TEMPLATE_PROJ: templates/Fabulous.Avalonia.Templates.proj | |
TEMPLATE_PKG: nupkgs/Fabulous.Avalonia.Templates | |
NUPKG_FOLDER: nupkgs | |
jobs: | |
build: | |
runs-on: macos-15 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Read last version from CHANGELOG.md | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
validation_level: warn | |
path: src/Fabulous.Avalonia/CHANGELOG.md | |
- name: Set nightly version | |
run: | | |
NIGHTLY_VERSION=${{ steps.changelog_reader.outputs.version }}-nightly-${GITHUB_RUN_ID} | |
echo "Nightly version is $NIGHTLY_VERSION" | |
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> "$GITHUB_ENV" | |
- name: Update xcode tools | |
run: sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer/ | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Install dotnet workload | |
run: dotnet workload restore | |
- name: Install workload wasm | |
run: dotnet workload install wasm-tools | |
- name: Restore | |
run: dotnet restore ${SLN_FILE} | |
- name: Build | |
run: dotnet build ${SLN_FILE} -p:Version=${NIGHTLY_VERSION} -c ${CONFIG} --no-restore | |
- name: Test | |
run: dotnet test ${SLN_FILE} -p:Version=${NIGHTLY_VERSION} -c ${CONFIG} --no-build | |
- name: Pack | |
run: | | |
find templates -type f -name template.json | xargs sed -i bak "s/PKG_VERSION/${NIGHTLY_VERSION}/g" | |
dotnet pack ${SLN_FILE} -p:Version=${NIGHTLY_VERSION} -c ${CONFIG} --property PackageOutputPath=${PWD}/${NUPKG_FOLDER} | |
dotnet pack ${TEMPLATE_PROJ} -p:Version=${NIGHTLY_VERSION} -p:IsNightlyBuild=true -c ${CONFIG} --property PackageOutputPath=${PWD}/${NUPKG_FOLDER} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Packages | |
path: nupkgs/ | |
- name: Setup for testing templates | |
run: | | |
LOCAL_NUGET_PATH=$(readlink -f ${NUPKG_FOLDER}) | |
dotnet nuget add source $LOCAL_NUGET_PATH --name local | |
dotnet new install Fabulous.Avalonia.Templates::${NIGHTLY_VERSION} | |
- name: Test single project template | |
run: | | |
dotnet new fabulous-avalonia -n SingleProjectTemplate | |
dotnet build SingleProjectTemplate -p:ManagePackageVersionsCentrally=false | |
- name: Test multi project template | |
run: | | |
dotnet new fabulous-avalonia-multi -n MultiProjectTemplate | |
dotnet build MultiProjectTemplate -p:ManagePackageVersionsCentrally=false | |
- name: Push | |
run: dotnet nuget push "nupkgs/*" -s https://nuget.pkg.github.com/fabulous-dev/index.json -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |