Skip to content

Merge pull request #40 from fabulous-dev/missing-modifiers #99

Merge pull request #40 from fabulous-dev/missing-modifiers

Merge pull request #40 from fabulous-dev/missing-modifiers #99

Workflow file for this run

name: Build
on:
push:
branches: [ 'main' ]
paths-ignore: [ 'docs/**' ]
permissions: write-all
env:
CONFIG: Release
SLN_FILE: Fabulous.XamarinForms.NoSamples.sln
TEMPLATE_PROJ: templates/Fabulous.XamarinForms.Templates.proj
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Read last version from CHANGELOG.md
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
path: ./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: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- 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} --no-build --property PackageOutputPath=${PWD}/nupkgs
dotnet pack ${TEMPLATE_PROJ} -p:Version=${NIGHTLY_VERSION} -p:IsNightlyBuild=true -c ${CONFIG} --property PackageOutputPath=${PWD}/nupkgs
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Packages
path: nupkgs/
- name: Push
run: dotnet nuget push "nupkgs/*.nupkg" -s https://nuget.pkg.github.com/fabulous-dev/index.json -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate