-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refa (github-actions.yml): merge the compile and deploy yml files int…
…o a single file this merging was done because in the world of github actions having a completely separate deploy workflow is extremely cumbersome due to inherent limitations in the way github shares secrets between workflows
- Loading branch information
1 parent
0d4546f
commit 3e4b1ee
Showing
7 changed files
with
125 additions
and
137 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,117 @@ | ||
# | ||
# https://docs.github.com/en/actions/migrating-to-github-actions/automated-migrations/migrating-from-azure-devops-with-github-actions-importer#environment-variable-mapping | ||
# | ||
|
||
name: 'Build, Pack & Deploy Nugets' | ||
|
||
env: | ||
BUILD_REPOSITORY_FOLDERPATH: ${{ github.workspace }} | ||
|
||
LAERDAL_SOURCE_BRANCH: ${{ github.ref }} | ||
LAERDAL_REPOSITORY_PATH: ${{ github.repository }} | ||
|
||
SCL_GITHUB_ACCESS_TOKEN: ${{ secrets.SCL_GITHUB_ACCESS_TOKEN }} | ||
SCL_AZURE_ARTIFACTS_API_KEY: ${{ secrets.SCL_AZURE_ARTIFACTS_API_KEY }} | ||
SCL_GITHUB_NUGET_FEED_USERNAME: ${{ secrets.SCL_GITHUB_NUGET_FEED_USERNAME }} | ||
|
||
|
||
on: | ||
workflow_call: # so that other workflows can trigger this | ||
workflow_dispatch: # allows to run this workflow manually from the actions tab | ||
|
||
push: | ||
branches: | ||
- '**' # '*' matches zero or more characters but does not match the `/` character '**' matches zero or more of any character | ||
|
||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: 'macos-14' | ||
|
||
# variable substitution is not supported in github at all so we cant do stuff like this | ||
# | ||
# env: | ||
# Build_Artifacts_Folderpath: ${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts | ||
|
||
steps: | ||
|
||
- name: '🔽 Checkout' | ||
uses: 'actions/checkout@v3' | ||
# with: | ||
# fetch-depth: 1 | ||
|
||
- name: '🛠 Setup Build Environment' | ||
shell: 'bash' | ||
run: | | ||
chmod +x "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \ | ||
&& \ | ||
"${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts/Laerdal.SetupBuildEnvironment.sh" \ | ||
"https://nuget.pkg.github.com/Laerdal/index.json" \ | ||
"${{env.SCL_GITHUB_NUGET_FEED_USERNAME}}" \ | ||
"${{env.SCL_GITHUB_ACCESS_TOKEN}}" \ | ||
"${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts" | ||
- name: '🏗 📦 Build, Pack & Announce New Release (if appropriate)' | ||
shell: 'bash' | ||
run: | | ||
cd "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Laerdal.Scripts" \ | ||
&& \ | ||
dotnet \ | ||
msbuild \ | ||
"Laerdal.Builder.targets" \ | ||
-m:1 \ | ||
-p:ShouldSkipMacCatalyst="false" \ | ||
\ | ||
-p:PackageOutputPath="${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts" \ | ||
-p:Laerdal_Gradle_Path="/opt/homebrew/opt/gradle@7/bin/gradle" \ | ||
-p:Laerdal_Source_Branch="${{env.LAERDAL_SOURCE_BRANCH}}" \ | ||
-p:Laerdal_Repository_Path="${{env.LAERDAL_REPOSITORY_PATH}}" \ | ||
-p:Laerdal_Github_Access_Token="${{env.SCL_GITHUB_ACCESS_TOKEN}}" \ | ||
-p:Laerdal_Test_Results_Folderpath="${{env.BUILD_REPOSITORY_FOLDERPATH}}/TestResults" | ||
- name: '📡 Publish Test Results' # https://github.com/marketplace/actions/publish-test-results | ||
uses: 'EnricoMi/publish-unit-test-result-action/macos@v2' | ||
if: always() | ||
with: | ||
files: | | ||
TestResults/**/TEST-*.xml | ||
TestResults/**/TEST-*.trx | ||
- name: '⬆️ Upload Artifacts' # to share with other workflows https://stackoverflow.com/a/77663335/863651 | ||
uses: 'actions/upload-artifact@v3' | ||
with: | ||
name: 'nugets' | ||
path: 'Artifacts/**/*.nupkg' | ||
|
||
- name: '🚀 Publish to the Laerdal Nuget Server on Github' # https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry | ||
shell: 'bash' | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/ksidirop/MAN-296-migrate-to-github-actions' | ||
run: | | ||
cd "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts/" \ | ||
&& \ | ||
ls . \ | ||
&& \ | ||
dotnet \ | ||
nuget \ | ||
push \ | ||
--source "https://nuget.pkg.github.com/Laerdal/index.json" \ | ||
--api-key "${{env.SCL_GITHUB_ACCESS_TOKEN}}" \ | ||
*nupkg | ||
# todo remove this once we fully transition over to the laerdal nuget server on github | ||
- name: '🚀 Publish to the Laerdal Nuget Server in Azure' # https://learn.microsoft.com/en-us/azure/devops/artifacts/quickstarts/github-actions?view=azure-devops | ||
shell: 'bash' | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/ksidirop/MAN-296-migrate-to-github-actions' | ||
run: | | ||
cd "${{env.BUILD_REPOSITORY_FOLDERPATH}}/Artifacts/" \ | ||
&& \ | ||
ls . \ | ||
&& \ | ||
dotnet \ | ||
nuget \ | ||
push \ | ||
--source "https://pkgs.dev.azure.com/LaerdalMedical/_packaging/LaerdalNuGet/nuget/v3/index.json" \ | ||
--api-key "${{env.SCL_AZURE_ARTIFACTS_API_KEY}}" \ | ||
*nupkg |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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