diff --git a/.github/actions/publish-config-parser/action.yml b/.github/actions/publish-config-parser/action.yml deleted file mode 100644 index 0bec8c9..0000000 --- a/.github/actions/publish-config-parser/action.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish configuration parser. - -description: It parses json configuration file which contains publish profiles. It can also select profiles by tags. - -inputs: - config-file: - type: string - required: true - tags: - type: string - default: '' - -outputs: - project-file: - value: ${{ steps.parse.outputs.project-file }} - output-name: - value: ${{ steps.parse.outputs.output-name }} - profiles: - value: ${{ steps.parse.outputs.profiles }} - -runs: - using: "composite" - - steps: - - id: parse - shell: bash - run: | - config=${{ inputs.config-file }} - - echo "project-file=$(jq -r ' ."project-file" ' $config )" >> $GITHUB_OUTPUT - echo "output-name=$(jq -r ' ."output-name" ' $config )" >> $GITHUB_OUTPUT - - profiles=$(jq -r --arg tags "${{ inputs.tags }}" '($tags / ",") as $tags | [ .profiles[] | (.tags) as $profile_tags | select(all($tags[]; IN($profile_tags[]))) | {os,runtime,configuration,framework,options} ]' $config) - echo "profiles={\"include\":$(echo $profiles)}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a1efd95..c444a21 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,7 +31,6 @@ on: types: [published] env: - dotnet-version: 9.x default-config-file: "./publish/config.json" default-target-os: all default-target-runtime: all @@ -42,12 +41,11 @@ jobs: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.publish-config-parser.outputs.profiles }} - status: ${{ steps.checker.outputs.status }} - project-file: ${{ steps.publish-config-parser.outputs.project-file }} - output-name: ${{ steps.publish-config-parser.outputs.output-name }} target-os: ${{ steps.inputs.outputs.target-os }} target-runtime: ${{ steps.inputs.outputs.target-runtime }} + matrix: ${{ steps.select-config.outputs.matrix }} + project-file: ${{ fromJSON(steps.read-options.outputs.content).project-file }} + output-name: ${{ fromJSON(steps.read-options.outputs.content).output-name }} steps: - name: Checkout @@ -67,12 +65,20 @@ jobs: echo "target-os=${target_os:=${{ env.default-target-os }}}" >> $GITHUB_OUTPUT echo "target-runtime=${target_runtime:=${{ env.default-target-runtime }}}" >> $GITHUB_OUTPUT - - name: Parse configuration "${{ github.event.inputs.config-file }}" - id: publish-config-parser - uses: ./.github/actions/publish-config-parser + - name: Read options "${{ github.event.inputs.config-file }}" + id: read-options + uses: finebits/github-actions/toolset/file/read@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0 with: - config-file: ${{ env.config-file }} - tags: "${{ env.target-os }},${{ env.target-runtime }}" + file: ${{ steps.inputs.outputs.config-file }} + + - name: Select configuration "${{ github.event.inputs.config-file }}" + id: select-config + uses: finebits/github-actions/toolset/select-configuration@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0 + with: + json-file: ${{ env.config-file }} + keywords: "${{ env.target-os }},${{ env.target-runtime }}" + configs-set-jsonpath: ".profiles" + keywords-set-jsonpath: ".tags" env: config-file: ${{ steps.inputs.outputs.config-file }} target-os: ${{ steps.inputs.outputs.target-os }} @@ -81,20 +87,16 @@ jobs: - name: Check profiles id: checker run: | - profiles='${{ steps.publish-config-parser.outputs.profiles }}' - length=$( echo $profiles | jq '.include | length' ) - - if(( $length > 0 )); then - echo "status=success" >> $GITHUB_OUTPUT - else - echo "status=failure" >> $GITHUB_OUTPUT - echo "No suitable publish profile found" + length=$( echo '${{ steps.select-config.outputs.config-json }}' | jq '. | length' ) + + if(( $length == 0 )); then + echo "::error::No suitable publish configuration found" + exit 1 fi publish: name: Publish needs: prepare - if: needs.prepare.outputs.status == 'success' runs-on: ${{ matrix.os }} strategy: matrix: ${{fromJson(needs.prepare.outputs.matrix)}} @@ -104,6 +106,7 @@ jobs: version-short: "${{ steps.version-number.outputs.preset-suffix }}" env: + dotnet-version: ${{ matrix.dotnet }} output-name: ${{ needs.prepare.outputs.output-name }} project-file: ${{ needs.prepare.outputs.project-file }} configuration: ${{ matrix.configuration }} @@ -134,20 +137,20 @@ jobs: - uses: finebits/github-actions/toolset/file/replace-text@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0 with: file: ./src/Eppie.CLI/Eppie.CLI/Options/AuthorizationOptions.cs - placeholder: '\"\"' - value: "${{ secrets.GMAIL_CLIENT_ID }}" + find-what: '\"\"' + replace-with: "${{ secrets.GMAIL_CLIENT_ID }}" - uses: finebits/github-actions/toolset/file/replace-text@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0 with: file: ./src/Eppie.CLI/Eppie.CLI/Options/AuthorizationOptions.cs - placeholder: '\"\"' - value: "${{ secrets.GMAIL_CLIENT_SECRET }}" + find-what: '\"\"' + replace-with: "${{ secrets.GMAIL_CLIENT_SECRET }}" - uses: finebits/github-actions/toolset/file/replace-text@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0 with: file: ./src/Eppie.CLI/Eppie.CLI/Options/AuthorizationOptions.cs - placeholder: '\"\"' - value: "${{ secrets.OUTLOOK_CLIENT_ID }}" + find-what: '\"\"' + replace-with: "${{ secrets.OUTLOOK_CLIENT_ID }}" - name: Publish ${{ env.output-name }} [${{ env.version-short }}] run: | diff --git a/publish/config.json b/publish/config.json index 9cebfdf..fa3bec0 100644 --- a/publish/config.json +++ b/publish/config.json @@ -9,8 +9,9 @@ "os": "windows-latest", "runtime": "win-x86", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" }, { @@ -18,8 +19,9 @@ "os": "windows-latest", "runtime": "win-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" }, { @@ -27,8 +29,9 @@ "os": "windows-latest", "runtime": "win-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" }, { @@ -36,8 +39,9 @@ "os": "ubuntu-latest", "runtime": "linux-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" }, { @@ -45,8 +49,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" }, { @@ -54,8 +59,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" }, { @@ -63,8 +69,9 @@ "os": "macos-latest", "runtime": "osx-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" }, { @@ -72,8 +79,9 @@ "os": "macos-latest", "runtime": "osx-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:DebugSymbols=false --property:DebugType=None --property:GenerateDocumentationFile=fasle", + "dotnet": "9.x" } ] } \ No newline at end of file diff --git a/publish/config.options-off.json b/publish/config.options-off.json index ee61078..1d7f659 100644 --- a/publish/config.options-off.json +++ b/publish/config.options-off.json @@ -9,8 +9,9 @@ "os": "windows-latest", "runtime": "win-x86", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" }, { @@ -18,8 +19,9 @@ "os": "windows-latest", "runtime": "win-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" }, { @@ -27,8 +29,9 @@ "os": "windows-latest", "runtime": "win-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" }, { @@ -36,8 +39,9 @@ "os": "ubuntu-latest", "runtime": "linux-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" }, { @@ -45,8 +49,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" }, { @@ -54,8 +59,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" }, { @@ -63,8 +69,9 @@ "os": "macos-latest", "runtime": "osx-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" }, { @@ -72,8 +79,9 @@ "os": "macos-latest", "runtime": "osx-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:DebugType=None", + "dotnet": "9.x" } ] } \ No newline at end of file diff --git a/publish/config.options-on.json b/publish/config.options-on.json index 3e35ef8..4129eb4 100644 --- a/publish/config.options-on.json +++ b/publish/config.options-on.json @@ -9,8 +9,9 @@ "os": "windows-latest", "runtime": "win-x86", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -18,8 +19,9 @@ "os": "windows-latest", "runtime": "win-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -27,8 +29,9 @@ "os": "windows-latest", "runtime": "win-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -36,8 +39,9 @@ "os": "ubuntu-latest", "runtime": "linux-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -45,8 +49,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -54,8 +59,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -63,8 +69,9 @@ "os": "macos-latest", "runtime": "osx-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -72,8 +79,9 @@ "os": "macos-latest", "runtime": "osx-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishTrimmed=true --property:TrimMode=partial --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" } ] } \ No newline at end of file diff --git a/publish/config.trim-off.json b/publish/config.trim-off.json index b8388fe..8fd43f9 100644 --- a/publish/config.trim-off.json +++ b/publish/config.trim-off.json @@ -9,8 +9,9 @@ "os": "windows-latest", "runtime": "win-x86", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -18,8 +19,9 @@ "os": "windows-latest", "runtime": "win-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -27,8 +29,9 @@ "os": "windows-latest", "runtime": "win-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -36,8 +39,9 @@ "os": "ubuntu-latest", "runtime": "linux-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -45,8 +49,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -54,8 +59,9 @@ "os": "ubuntu-latest", "runtime": "linux-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -63,8 +69,9 @@ "os": "macos-latest", "runtime": "osx-x64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" }, { @@ -72,8 +79,9 @@ "os": "macos-latest", "runtime": "osx-arm64", "configuration": "release", - "framework": "net8.0", - "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None" + "framework": "net9.0", + "options" : "--self-contained --property:PublishSingleFile=true --property:PublishReadyToRun=true --property:DebugType=None", + "dotnet": "9.x" } ] } \ No newline at end of file