From b365599afb3cdc3e9285ad52f6fb992bc0906250 Mon Sep 17 00:00:00 2001 From: Dominique Delahaye Date: Mon, 19 Aug 2024 15:52:17 +0200 Subject: [PATCH] append yml suite --- .github/generate_release_notes.yml | 12 +++++ .github/workflows/4D.entitlements | 32 ++++++++++++ .github/workflows/build.yml | 81 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 79 +++++++++++++++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 .github/generate_release_notes.yml create mode 100644 .github/workflows/4D.entitlements create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/generate_release_notes.yml b/.github/generate_release_notes.yml new file mode 100644 index 0000000..6e8a502 --- /dev/null +++ b/.github/generate_release_notes.yml @@ -0,0 +1,12 @@ +changelog: + categories: + - title: ๐Ÿ• Features + labels: + - features + - user story + - title: ๐Ÿ‘’ Bugs + labels: + - bug + -title: ๐ŸŽจ Improvements + labels: + - enhancement \ No newline at end of file diff --git a/.github/workflows/4D.entitlements b/.github/workflows/4D.entitlements new file mode 100644 index 0000000..3913128 --- /dev/null +++ b/.github/workflows/4D.entitlements @@ -0,0 +1,32 @@ + + + + + com.apple.security.automation.apple-events + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.debugger + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.cs.disable-library-validation + + com.apple.security.device.audio-input + + com.apple.security.device.camera + + com.apple.security.personal-information.addressbook + + com.apple.security.personal-information.calendars + + com.apple.security.personal-information.location + + com.apple.security.personal-information.photos-library + + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..80926b5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,81 @@ +name: build +on: + push: + paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**'] + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**'] + workflow_dispatch: + +env: + TOOL4D_PRODUCT_LINE: '20Rx' + TOOL4D_VERSION: '20R5' + +jobs: + build: + name: "Build on ${{ matrix.os }}" + strategy: + fail-fast: false + matrix: + os: [ ARM64, X64 ] + runs-on: ${{ matrix.os }} + steps: + - name: ๐Ÿ“„ Checkout repository + uses: actions/checkout@v4 + with: + lfs: true + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: ๐Ÿ—๏ธ Build ${{ github.event.repository.name }} + uses: 4d/build4d-action@main + with: + project: ${{ github.event.repository.name }}/Project/${{ github.event.repository.name }}.4DProject + product-line: ${{env.TOOL4D_PRODUCT_LINE}} + version: ${{env.TOOL4D_VERSION}} + build: official + actions: "build,pack" + token: ${{ secrets.DLTK }} + + - name: ๐Ÿšš Copy ${{ github.event.repository.name }}.4dbase to ${{ github.event.repository.name }}_UnitTests/Components directory + run: | + cp -r ${{ github.event.repository.name }}/build/ ${{ github.event.repository.name }}_UnitTests/Components + + - name: ๐Ÿ—๏ธ Build ${{ github.event.repository.name }}_UnitTests + uses: 4d/build4d-action@main + with: + project: ${{ github.event.repository.name }}_UnitTests/Project/${{ github.event.repository.name }}_UnitTests.4DProject + product-line: ${{env.TOOL4D_PRODUCT_LINE}} + version: ${{env.TOOL4D_VERSION}} + build: official + actions: "build" + token: ${{ secrets.DLTK }} + + - name: ๐Ÿงช Run Unit Tests + uses: 4d/tool4d-action@main + with: + project: ${{ github.event.repository.name }}_UnitTests/Project/${{ github.event.repository.name }}_UnitTests.4DProject + product-line: ${{env.TOOL4D_PRODUCT_LINE}} + version: ${{env.TOOL4D_VERSION}} + build: official + token: ${{ secrets.DLTK }} + startup-method: start_tests + + - name : ๐Ÿšข Archive Actifacts + uses: actions/upload-artifact@v4 + with: + name: "UT-${{ github.event.repository.name }}.${{runner.os}}.text" + path: "UT-${{ github.event.repository.name }}.txt" + + # Recherche de la chaรฎne "GLOBAL RESULT : SUCCESS" dans le fichier UT-QPDF.txt + - name : โœ” Analyze result test + shell: bash + run: | + if grep -r "GLOBAL RESULT : SUCCESS" "UT-${{ github.event.repository.name }}.txt"; then + echo "Unit tests passed" + exit 0 + else + echo "Unit tests failed" + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a7cdbdc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,79 @@ +name: Release +on: + release: + types: [published] + +permissions: + contents: write + packages: write + +env: + TOOL4D_PRODUCT_LINE: '20Rx' + TOOL4D_VERSION: '20R5' + +jobs: + build: + name: "Build" + runs-on: [self-hosted,ARM64] + steps: + - name: ๐Ÿ“„ Checkout repository + uses: actions/checkout@v4 + with: + lfs: true + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: ๐Ÿ—๏ธ Build ${{ github.event.repository.name }} + uses: 4d/build4d-action@main + with: + project: ${{ github.event.repository.name }}/Project/${{ github.event.repository.name }}.4DProject + product-line: ${{env.TOOL4D_PRODUCT_LINE}} + version: ${{env.TOOL4D_VERSION}} + build: official + targets : all + actions: "build,pack,sign,archive" + sign-files: "Helpers/qpdf/mac/ub/bin/qpdf" + sign-certificate: "Developer ID Application: 4D" + token: ${{ secrets.DLTK }} + + - name: Notarize + run: | + xcrun notarytool submit "${{ github.event.repository.name }}/build/${{ github.event.repository.name }}.zip" --keychain-profile "notary" --wait >> notary_tool.log + if grep -r "status: Accepted" "notary_tool.log"; then + echo "Notarize Success" + exit 0 + else + echo "Notarize Failed" + exit 1 + fi + + - name: Upload Artifact + if: github.event_name != 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: "${{ github.event.repository.name }}.zip" + path: "${{ github.event.repository.name }}/build/${{ github.event.repository.name }}.zip" + retention-days: 1 + if-no-files-found: error + release: + needs: build + name: "Release Component" + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ“„ Checkout repository + uses: actions/checkout@v4 + with: + lfs: true + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: "${{ github.event.repository.name }}.zip" + path: artifact + - name: Display Artifact Directory Content + run: ls -R artifact + - name: ๐Ÿ“ฆ release package + run: | + gh release upload ${{github.event.release.tag_name}} "${{github.workspace}}/artifact/${{ github.event.repository.name }}.zip" + env: + GITHUB_TOKEN: ${{ github.TOKEN }}