Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #162

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #162

Workflow file for this run

name: CI/CD
on:
push:
tags: "v*"
branches: [main, develop, feature/*, release/*]
pull_request:
branches: [main, develop]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build ./GodotHub/GodotHub.csproj --no-restore
- name: Test
run: dotnet test ./GodotHub.Tests/GodotHub.Tests.csproj --verbosity normal
package-standalone:
needs: build-and-test
runs-on: ubuntu-latest
strategy:
matrix:
runtime: [win-x64, linux-x64] # osx-x64
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true
- name: Restore dependencies
run: dotnet restore
- name: Publish
run: dotnet publish ./GodotHub/GodotHub.csproj -c Release -r ${{ matrix.runtime }} --self-contained -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=true
- name: Zip all
run: |
if [ "${{ matrix.runtime }}" == "win-x64" ]; then
7z a -tzip "godot-hub-${{ matrix.runtime }}.zip" ./GodotHub/bin/Release/net6.0/${{ matrix.runtime }}/publish/*
else
tar czvf "godot-hub-${{ matrix.runtime }}.tar.gz" ./GodotHub/bin/Release/net6.0/${{ matrix.runtime }}/publish/*
fi
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: godot-hub-${{ steps.gitversion.outputs.semVer }}
path: |
*.zip
*.tar.gz
package-dotnet-tool:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true
- name: Restore dependencies
run: dotnet restore
- name: Pack
run: dotnet pack ./GodotHub/GodotHub.csproj -c Release
- name: Archive nupkg artifacts
uses: actions/upload-artifact@v2
with:
name: godot-hub-${{ steps.gitversion.outputs.semVer }}
path: |
./GodotHub/bin/Release/*.nupkg
# package-windows-store-msix:
# needs: build-and-test
# runs-on: windows-2022
# env:
# Solution_Name: GodotHub.sln
# Wap_Project_Directory: GodotHub.WindowsStore
# Wap_Project_Path: GodotHub.WindowsStore\GodotHub.WindowsStore.wapproj
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Setup .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 6.0.x
# - name: Install GitVersion
# uses: gittools/actions/gitversion/setup@v0.9.7
# with:
# versionSpec: '5.x'
# - name: Determine Version
# id: gitversion
# uses: gittools/actions/gitversion/execute@v0.9.7
# with:
# useConfigFile: true
# - name: Update manifest version
# run: |
# [xml]$manifest = get-content ".\$env:Wap_Project_Directory\Package.appxmanifest"
# $manifest.Package.Identity.Version = "${{ steps.gitversion.outputs.AssemblySemVer }}"
# $manifest.save(".\$env:Wap_Project_Directory\Package.appxmanifest")
# - name: Setup MSBuild.exe
# uses: microsoft/setup-msbuild@v1.1
# with:
# vs-version: '[17.0,18.0)'
# - name: Restore the application
# run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier="win-x64"
# env:
# Configuration: Release
# - name: Decode the pfx
# run: |
# $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
# $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
# [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
# - name: Create the app package
# run: msbuild $env:Wap_Project_Path /p:Platform=$env:TargetPlatform /p:AppxBundlePlatforms=$env:Appx_Bundle_Platforms /p:Configuration=$env:Configuration /p:SolutionDir=. /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword="${{ secrets.Pfx_Key }}"
# env:
# Appx_Bundle: Always
# TargetPlatform: x64
# Appx_Bundle_Platforms: x64
# Appx_Package_Build_Mode: StoreUpload
# Configuration: Release
# - name: Remove the pfx
# run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: MSIX Package
# path: ${{ env.Wap_Project_Directory }}\AppPackages
release:
needs: [package-standalone, package-dotnet-tool]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Downlad artifacts
id: download
uses: actions/download-artifact@v4.1.7
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{steps.download.outputs.download-path}}/**/*.zip
${{steps.download.outputs.download-path}}/**/*.tar.gz
${{steps.download.outputs.download-path}}/**/*.nupkg
- name: Publish to NuGet
run: dotnet nuget push ${{steps.download.outputs.download-path}}/**/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}