Publish #75
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '*/Project/Sources/**/*.4dm' | |
| - '*/Project/Sources/*/*.4DForm' | |
| - '*/Project/Sources/*.4DCatalog' | |
| - '*/Project/Resources/**' | |
| workflow_dispatch: | |
| inputs: | |
| use_self_hosted: | |
| type: boolean | |
| description: when github hosted runners are busy | |
| required: true | |
| default: false | |
| mode: | |
| type: choice | |
| description: semantic versioning | |
| options: | |
| - none | |
| - patch | |
| - minor | |
| - major | |
| required: true | |
| env: | |
| project_path: llama-cpp/Project/llama-cpp.4DProject | |
| jobs: | |
| publish: | |
| if: ${{ github.event.inputs.use_self_hosted != 'true' }} | |
| permissions: write-all | |
| runs-on: [macos-latest] | |
| steps: | |
| - name: configure | |
| id: configure | |
| uses: miyako/4D/.github/actions/bash/configure@v1 | |
| with: | |
| mode: ${{ inputs.mode || 'patch' }} | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: set version | |
| id: version | |
| uses: miyako/4D/.github/actions/package-set-version@v1 | |
| with: | |
| mode: ${{ steps.configure.outputs.mode }} | |
| - name: get tool version | |
| id: tool | |
| uses: miyako/4D/.github/actions/tool4d-get-version@v1 | |
| - name: get tool4d | |
| id: get | |
| uses: miyako/4D/.github/actions/tool4d-download@v1 | |
| with: | |
| platform: ${{ steps.tool.outputs.platform }} | |
| branch: ${{ steps.tool.outputs.branch }} | |
| version: ${{ steps.tool.outputs.version }} | |
| build: ${{ steps.tool.outputs.build }} | |
| arch: ${{ steps.tool.outputs.arch }} | |
| - name: build | |
| id: build | |
| uses: miyako/4D/.github/actions/build-component@v1 | |
| with: | |
| project_path: ${{ steps.configure.outputs.project_path }} | |
| pack_project: 'true' | |
| use_standard_zip: 'true' | |
| - name: setup keychain | |
| id: keychain | |
| uses: miyako/4D/.github/actions/deployment-setup-keychain@v1 | |
| with: | |
| APPLE_DEVELOPER_ID_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_ID_CERTIFICATE }} | |
| APPLE_DEVELOPER_ID_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_CERTIFICATE_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| - name: codesign | |
| id: codesign | |
| uses: miyako/4D/.github/actions/deployment-codesign-product@v1 | |
| with: | |
| sign: ${{ secrets.CODESIGN_APPLE_ID }} | |
| apple_id: ${{ secrets.NOTARYTOOL_APPLE_ID }} | |
| team_id: ${{ secrets.NOTARYTOOL_TEAM_ID }} | |
| password: ${{ secrets.NOTARYTOOL_PASSWORD }} | |
| product_path: ${{ steps.build.outputs.product_path }} | |
| keychain: ${{ steps.keychain.outputs.KEYCHAIN_PATH }} | |
| - name: zip | |
| id: zip | |
| uses: miyako/4D/.github/actions/deployment-create-zip@v1 | |
| with: | |
| dmg_path: ${{ steps.codesign.outputs.dmg_path }} | |
| zip_path: ${{ steps.codesign.outputs.zip_path }} | |
| - name: upload assets | |
| id: upload | |
| uses: miyako/4D/.github/actions/deployment-release-assets@v1 | |
| with: | |
| dmg_path: ${{ steps.zip.outputs.dmg_path }} | |
| zip_path: ${{ steps.zip.outputs.zip_path }} | |
| tag_name: ${{ steps.version.outputs.version }} | |
| release_name: ${{ steps.version.outputs.version }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-locally: | |
| if: ${{ github.event.inputs.use_self_hosted == 'true' }} | |
| permissions: write-all | |
| runs-on: [self-hosted, macos] | |
| steps: | |
| - name: configure | |
| id: configure | |
| uses: miyako/4D/.github/actions/bash/configure@v1 | |
| with: | |
| mode: ${{ inputs.mode || 'patch' }} | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: set version | |
| id: version | |
| uses: miyako/4D/.github/actions/package-set-version@v1 | |
| with: | |
| mode: ${{ steps.configure.outputs.mode }} | |
| - name: get tool version | |
| id: tool | |
| uses: miyako/4D/.github/actions/tool4d-get-version@v1 | |
| - name: get tool4d | |
| id: get | |
| uses: miyako/4D/.github/actions/tool4d-download@v1 | |
| with: | |
| platform: ${{ steps.tool.outputs.platform }} | |
| branch: ${{ steps.tool.outputs.branch }} | |
| version: ${{ steps.tool.outputs.version }} | |
| build: ${{ steps.tool.outputs.build }} | |
| arch: ${{ steps.tool.outputs.arch }} | |
| - name: build | |
| id: build | |
| uses: miyako/4D/.github/actions/build-component@v1 | |
| with: | |
| project_path: ${{ steps.configure.outputs.project_path }} | |
| pack_project: 'true' | |
| use_standard_zip: 'true' | |
| - name: setup keychain | |
| id: keychain | |
| uses: miyako/4D/.github/actions/deployment-setup-keychain@v1 | |
| with: | |
| APPLE_DEVELOPER_ID_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_ID_CERTIFICATE }} | |
| APPLE_DEVELOPER_ID_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_CERTIFICATE_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| - name: codesign | |
| id: codesign | |
| uses: miyako/4D/.github/actions/deployment-codesign-product@v1 | |
| with: | |
| sign: ${{ secrets.CODESIGN_APPLE_ID }} | |
| apple_id: ${{ secrets.NOTARYTOOL_APPLE_ID }} | |
| team_id: ${{ secrets.NOTARYTOOL_TEAM_ID }} | |
| password: ${{ secrets.NOTARYTOOL_PASSWORD }} | |
| product_path: ${{ steps.build.outputs.product_path }} | |
| keychain: ${{ steps.keychain.outputs.KEYCHAIN_PATH }} | |
| - name: zip | |
| id: zip | |
| uses: miyako/4D/.github/actions/deployment-create-zip@v1 | |
| with: | |
| dmg_path: ${{ steps.codesign.outputs.dmg_path }} | |
| zip_path: ${{ steps.codesign.outputs.zip_path }} | |
| - name: upload assets | |
| id: upload | |
| uses: miyako/4D/.github/actions/deployment-release-assets@v1 | |
| with: | |
| dmg_path: ${{ steps.zip.outputs.dmg_path }} | |
| zip_path: ${{ steps.zip.outputs.zip_path }} | |
| tag_name: ${{ steps.version.outputs.version }} | |
| release_name: ${{ steps.version.outputs.version }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |