name: Windows Package Manager (WinGet) on: release: types: [published] workflow_call: inputs: tagName: description: Release tag to publish. required: true type: string workflow_dispatch: inputs: tagName: description: Release tag to publish. required: true type: string jobs: publish: name: ๐ŸชŸ winget runs-on: ubuntu-latest permissions: contents: read env: # Komac needs a classic PAT with public_repo. Fine-grained tokens cannot # open the winget-pkgs PR and may lack write access to the fork. WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }} steps: - name: ๐Ÿ”„ Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 1 - name: ๐Ÿท๏ธ Resolve version id: version shell: bash env: TAG: ${{ inputs.tagName || github.event.release.tag_name }} run: bash scripts/ci/resolve-version.sh - name: ๐Ÿ†™ Sync the winget-pkgs fork if: env.WINGET_TOKEN != '' uses: michidk/run-komac@9b27eadc6e9235c252444a437d246c139da2f57f # v2.1.0 with: komac-version: 2.17.2 args: "sync-fork --token=${{ env.WINGET_TOKEN }}" - name: ๐ŸชŸ Update the package if: env.WINGET_TOKEN != '' uses: michidk/run-komac@9b27eadc6e9235c252444a437d246c139da2f57f # v2.1.0 with: komac-version: 2.17.2 args: >- update lemueldls.typbase --version ${{ steps.version.outputs.version }} --urls https://github.com/lemueldls/typbase/releases/download/${{ steps.version.outputs.tag }}/Typbase_${{ steps.version.outputs.version }}_x64.exe --submit --token=${{ env.WINGET_TOKEN }} cleanup: name: ๐Ÿงน winget branches runs-on: ubuntu-latest env: WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }} steps: - name: ๐Ÿงน Delete branches from merged or closed PRs if: env.WINGET_TOKEN != '' uses: michidk/run-komac@9b27eadc6e9235c252444a437d246c139da2f57f # v2.1.0 with: komac-version: 2.16.0 args: "cleanup --only-merged --token=${{ env.WINGET_TOKEN }}"