|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + release: |
| 4 | + types: [published] |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: write |
| 8 | + packages: write |
| 9 | + |
| 10 | +env: |
| 11 | + TOOL4D_PRODUCT_LINE: '20Rx' |
| 12 | + TOOL4D_VERSION: '20R10' |
| 13 | + TOOL4D_BUILDNUMBER : '100221' |
| 14 | + |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + name: "Build" |
| 19 | + runs-on: [macOS] |
| 20 | + steps: |
| 21 | + - name: 📄 Checkout repository |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + lfs: true |
| 25 | + # Disabling shallow clone is recommended for improving relevancy of reporting |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Checkout build4d-action |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + repository: 4d/build4d-action |
| 32 | + token: ${{ secrets.GH_4D_ACTION_TOKEN }} |
| 33 | + path: .github/actions/build4d-action |
| 34 | + |
| 35 | + - name: Checkout tool4d-action |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + repository: 4d/tool4d-action |
| 39 | + token: ${{ secrets.GH_4D_ACTION_TOKEN }} |
| 40 | + path: .github/actions/tool4d-action |
| 41 | + |
| 42 | + |
| 43 | + - name: 🏗️ Build ${{ github.event.repository.name }} |
| 44 | + uses: ./.github/actions/build4d-action |
| 45 | + with: |
| 46 | + project: ${{ github.workspace }}/${{ github.event.repository.name }}/Project/${{ github.event.repository.name }}.4DProject |
| 47 | + product-line: ${{env.TOOL4D_PRODUCT_LINE}} |
| 48 | + version: ${{env.TOOL4D_VERSION}} |
| 49 | + targets : all |
| 50 | + #actions: "build,pack,sign,archive" |
| 51 | + actions: "build,pack,archive" |
| 52 | + build: ${{env.TOOL4D_BUILDNUMBER}} |
| 53 | + token: ${{ secrets.TOOL4D_DL_TOKEN }} |
| 54 | + ignore-warnings: true |
| 55 | + |
| 56 | + |
| 57 | + #- name: Notarize |
| 58 | + # run: | |
| 59 | + # xcrun notarytool submit "${{ github.event.repository.name }}/build/${{ github.event.repository.name }}.zip" --keychain-profile "notary" --wait >> notary_tool.log |
| 60 | + # if grep -r "status: Accepted" "notary_tool.log"; then |
| 61 | + # echo "Notarize Success" |
| 62 | + # exit 0 |
| 63 | + # else |
| 64 | + # echo "Notarize Failed" |
| 65 | + # exit 1 |
| 66 | + # fi |
| 67 | + |
| 68 | + - name: Upload Artifact |
| 69 | + if: github.event_name != 'pull_request' |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: "${{ github.event.repository.name }}.zip" |
| 73 | + path: "${{ github.event.repository.name }}/build/${{ github.event.repository.name }}.zip" |
| 74 | + retention-days: 1 |
| 75 | + if-no-files-found: error |
| 76 | + release: |
| 77 | + needs: build |
| 78 | + name: "Release Component" |
| 79 | + runs-on: ubuntu-latest |
| 80 | + steps: |
| 81 | + - name: 📄 Checkout repository |
| 82 | + uses: actions/checkout@v4 |
| 83 | + with: |
| 84 | + lfs: true |
| 85 | + # Disabling shallow clone is recommended for improving relevancy of reporting |
| 86 | + fetch-depth: 0 |
| 87 | + |
| 88 | + - name: Download packages |
| 89 | + uses: actions/download-artifact@v4 |
| 90 | + with: |
| 91 | + name: "${{ github.event.repository.name }}.zip" |
| 92 | + path: artifact |
| 93 | + |
| 94 | + - name: Display Artifact Directory Content |
| 95 | + run: ls -R artifact |
| 96 | + |
| 97 | + - name: 📦 release package |
| 98 | + run: | |
| 99 | + gh release upload ${{github.event.release.tag_name}} "${{github.workspace}}/artifact/${{ github.event.repository.name }}.zip" |
| 100 | + env: |
| 101 | + GITHUB_TOKEN: ${{ github.TOKEN }} |
0 commit comments