-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from md-owes/develop
added mac build and github cache along with separate workflow for release
- Loading branch information
Showing
3 changed files
with
215 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: MacBuild | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
pull_request: | ||
branches: [main] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
env: | ||
DOTNET_NOLOGO: true # Disable the .NET logo | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry | ||
|
||
jobs: | ||
calculate-version: | ||
name: Calculate Version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
semVer: ${{ steps.gitversion.outputs.semVer }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3.5.3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/setup@v0 | ||
with: | ||
versionSpec: "5.x" | ||
preferLatestVersion: true | ||
|
||
- name: Determine Version | ||
id: gitversion | ||
uses: gittools/actions/gitversion/execute@v0 | ||
|
||
buildmacCatalyst: | ||
runs-on: macos-latest | ||
name: Mac Build | ||
needs: calculate-version | ||
env: | ||
SEMVER: ${{ needs.calculate-version.outputs.semVer }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3.2.0 | ||
with: | ||
dotnet-version: | | ||
7.0.x | ||
- name: List installed .NET info | ||
shell: pwsh | ||
run: dotnet --info | ||
|
||
# - name: Restore nuget packages | ||
# run: | | ||
# cd 6.0/Apps/WeatherTwentyOne/src/ | ||
# dotnet restore WeatherTwentyOne.sln | ||
|
||
- name: Install .NET MAUI | ||
shell: bash | ||
run: | | ||
dotnet workload install maui | ||
- name: Create MAUI version | ||
uses: managedcode/MAUIAppVersion@v1 | ||
with: | ||
csproj: "directory-deleter/directory-deleter.csproj" | ||
version: "0" | ||
displayVersion: ${{env.SEMVER}} | ||
printFile: true | ||
|
||
- name: Restore Dependencies | ||
run: dotnet restore directory-deleter/directory-deleter.csproj | ||
|
||
# https://docs.microsoft.com/en-us/dotnet/maui/macos/deployment/overview | ||
- name: Build MacCatalyst App | ||
shell: bash | ||
run: | | ||
dotnet build -f net7.0-maccatalyst -c Release -o ./bin/publish/artifacts | ||
dotnet publish -f net7.0-maccatalyst -c Release -p:CreatePackage=true -o ./bin/publish/artifacts | ||
- name: Display publish path | ||
shell: bash | ||
run: | | ||
cd ./bin/publish/artifacts | ||
ls | ||
# - name: Build and Run UnitTests | ||
# shell: bash | ||
# run: | | ||
# dotnet build <path to unit test csproj> | ||
# dotnet test <path to unit test csproj> --no-build --verbosity normal | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: artifacts-mac | ||
path: | | ||
./bin/publish/artifacts/**/*.pkg | ||
- name: Upload cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./bin/publish/artifacts/**/*.pkg | ||
key: directory-deleter-${{runner.os}}-v${{env.SEMVER}} | ||
enableCrossOsArchive: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Release App | ||
on: | ||
workflow_run: | ||
workflows: ["WindowsBuid,MacBuild"] | ||
branches: [main] | ||
types: [completed] | ||
permissions: | ||
contents: read | ||
env: | ||
DOTNET_NOLOGO: true # Disable the .NET logo | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry | ||
|
||
jobs: | ||
release-artifacts: | ||
name: Release Artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ahmadnassri/action-workflow-run-wait@v1 | ||
|
||
- name: Install GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/setup@v0 | ||
with: | ||
versionSpec: "0.10.x" | ||
preferLatestVersion: true | ||
|
||
- uses: actions/cache/restore@v3 | ||
id: mac-cache | ||
with: | ||
path: "**/*.pkg" | ||
key: directory-deleter-macos-v${{env.SEMVER}} | ||
|
||
- uses: actions/cache/restore@v3 | ||
id: winexe-cache | ||
with: | ||
path: "**/*.exe.zip" | ||
key: directory-deleter-macos-v${{env.SEMVER}} | ||
|
||
- uses: actions/cache/restore@v3 | ||
id: winmsi-cache | ||
with: | ||
path: "**/*.msi.zip" | ||
key: directory-deleter-macos-v${{env.SEMVER}} | ||
|
||
- name: Create git tag | ||
run: | | ||
git remote remove origin | ||
git remote add origin https://${{ secrets.GITRELEASEMANAGERALLACCESS }}@github.com/md-owes/directory-deleter | ||
git tag ${{secrets.SEMVER}} | ||
git push origin ${{secrets.SEMVER}} | ||
- name: Create release with GitReleaseManager | ||
uses: gittools/actions/gitreleasemanager/create@v0.10.2 | ||
with: | ||
token: ${{ secrets.GITRELEASEMANAGERALLACCESS }} | ||
owner: "md-owes" | ||
repository: "directory-deleter" | ||
milestone: ${{secrets.SEMVER}} | ||
name: "${{secrets.SEMVER}}" | ||
assets: | | ||
directory-deleter-v${{secrets.SEMVER}}.msix.zip | ||
directory-deleter-v${{secrets.SEMVER}}.exe.zip | ||
directory-deleter-v${{secrets.SEMVER}}.pkg.zip |
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