|
| 1 | +# SPDX-FileCopyrightText: 2024 Howetuft |
| 2 | +# |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | + |
| 6 | +name: LuxCore Python Wheels Releaser |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + release-tag: |
| 12 | + description: "Tag for the release" |
| 13 | + required: True |
| 14 | + default: Test |
| 15 | + type: string |
| 16 | + release-name: |
| 17 | + description: "Release name" |
| 18 | + required: False |
| 19 | + default: Test |
| 20 | + type: string |
| 21 | + release-title: |
| 22 | + description: "Release title" |
| 23 | + required: False |
| 24 | + default: Test |
| 25 | + type: string |
| 26 | + allow-updates: |
| 27 | + description: "Update existing release (if any)" |
| 28 | + required: True |
| 29 | + type: boolean |
| 30 | + default: True |
| 31 | + prerelease: |
| 32 | + description: "Prerelease" |
| 33 | + required: True |
| 34 | + type: boolean |
| 35 | + default: True |
| 36 | + rebuild-all: |
| 37 | + description: "Rebuild all" |
| 38 | + required: True |
| 39 | + type: boolean |
| 40 | + default: False |
| 41 | + |
| 42 | +jobs: |
| 43 | + call-build-wheels: |
| 44 | + uses: ./.github/workflows/wheels.yml |
| 45 | + |
| 46 | + create-release: |
| 47 | + name: 'Create release' |
| 48 | + if: github.event_name == 'workflow_dispatch' |
| 49 | + runs-on: ubuntu-latest |
| 50 | + needs: [call-build-wheels] |
| 51 | + permissions: |
| 52 | + id-token: write |
| 53 | + attestations: write |
| 54 | + contents: write |
| 55 | + steps: |
| 56 | + - run: | |
| 57 | + echo "Creating release '${{ inputs.release-version }}'" |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + - uses: actions/download-artifact@v4 |
| 60 | + with: |
| 61 | + pattern: luxcore-deps-* |
| 62 | + path: ${{ github.workspace }}/dist |
| 63 | + merge-multiple: false |
| 64 | + |
| 65 | + - name: Display structure of downloaded files |
| 66 | + run: ls -Rl ${{ github.workspace }}/dist |
| 67 | + |
| 68 | + - name: Generate artifact attestations |
| 69 | + uses: actions/attest-build-provenance@v1.4.3 |
| 70 | + with: |
| 71 | + subject-path: ${{ github.workspace }}/dist/* |
| 72 | + |
| 73 | + - name: Re-zip artifacts |
| 74 | + working-directory: ${{ github.workspace }}/dist |
| 75 | + run: | |
| 76 | + mkdir ../artifacts |
| 77 | + for d in */ ; do |
| 78 | + d2=${d%/} |
| 79 | + echo "zip ${d2}" |
| 80 | + zip -j ../artifacts/${d2}.zip ${d2}/* |
| 81 | + done |
| 82 | +
|
| 83 | + - id: make-release |
| 84 | + # Use full length commit SHA, otherwise CodeQL complains... |
| 85 | + uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 |
| 86 | + with: |
| 87 | + name: ${{ inputs.release-name }} |
| 88 | + tag: ${{ inputs.release-tag }} |
| 89 | + artifacts: artifacts/* |
| 90 | + removeArtifacts: true |
| 91 | + allowUpdates: ${{ inputs.allow-updates }} |
| 92 | + prerelease: ${{ inputs.prerelease }} |
| 93 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 94 | + updateOnlyUnreleased: true |
| 95 | + |
| 96 | + - run: | |
| 97 | + echo "### Release""" >> $GITHUB_STEP_SUMMARY |
| 98 | + echo ${{ steps.make-release.outputs.html_url }} >> $GITHUB_STEP_SUMMARY |
| 99 | +
|
0 commit comments