Skip to content

Commit 2f883a5

Browse files
authored
Merge pull request #10 from 4d/sign_and_notarize
Refactor GitHub Actions workflows: update build and release steps to …
2 parents a8ff380 + d051059 commit 2f883a5

File tree

2 files changed

+30
-61
lines changed

2 files changed

+30
-61
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Build
22

33
on:
44
push:
5-
branches: ['**'] # Only run on branches
6-
tags-ignore: ['*'] # Ignore all tags
75
paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**']
6+
branches:
7+
- main # Only run on branches
8+
tags-ignore: ['*'] # Ignore all tags
89
pull_request:
910
types: [opened, synchronize, reopened]
1011
paths-ignore: ['**.md', '.vscode/**','docs/**','pictures/**']
12+
workflow_dispatch:
1113

1214
env:
1315
TOOL4D_PRODUCT_LINE: '20Rx'
@@ -23,7 +25,7 @@ jobs:
2325
strategy:
2426
fail-fast: false
2527
matrix:
26-
os: [ windows-latest,macos-latest]
28+
os: [ macOS,Windows]
2729

2830

2931
runs-on: ${{ matrix.os }}
@@ -35,31 +37,8 @@ jobs:
3537
# Disabling shallow clone is recommended for improving relevancy of reporting
3638
fetch-depth: 0
3739

38-
39-
- name: Checkout build4d-action
40-
uses: actions/checkout@v5
41-
with:
42-
repository: 4d/build4d-action
43-
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
44-
path: .github/actions/build4d-action
45-
46-
- name: Checkout tool4d-action
47-
uses: actions/checkout@v5
48-
with:
49-
repository: 4d/tool4d-action
50-
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
51-
path: .github/actions/tool4d-action
52-
53-
- name: Checkout setup4d-action
54-
uses: actions/checkout@v5
55-
with:
56-
repository: 4d/setup4d-action
57-
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
58-
path: .github/actions/setup4d-action
59-
60-
6140
- name: 🏗️ Build ${{ github.event.repository.name }}
62-
uses: ./.github/actions/build4d-action
41+
uses: 4d/build4d-action@main
6342
with:
6443
project: ${{ github.workspace }}/${{ github.event.repository.name }}/Project/${{ github.event.repository.name }}.4DProject
6544
product-line: ${{env.TOOL4D_PRODUCT_LINE}}
@@ -73,6 +52,13 @@ jobs:
7352
run: |
7453
cp -r ${{ github.workspace }}/${{ github.event.repository.name }}/build/ ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Components
7554
55+
- name: Checkout setup4d-action
56+
uses: actions/checkout@v4
57+
with:
58+
repository: 4d/setup4d-action
59+
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
60+
path: .github/actions/setup4d-action
61+
7662
- name: Download Setup4d
7763
uses: ./.github/actions/setup4d-action
7864
with:
@@ -86,7 +72,7 @@ jobs:
8672
mv ${{ github.workspace }}/.github/actions/setup4d-action/work/ ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Work/
8773
8874
- name: 🏗️ Build ${{ github.event.repository.name }}_UnitTests
89-
uses: ./.github/actions/build4d-action
75+
uses: 4d/build4d-action@main
9076
with:
9177
project: ${{ github.workspace }}/${{ github.event.repository.name }}_UnitTests/Project/${{ github.event.repository.name }}_UnitTests.4DProject
9278
product-line: ${{env.TOOL4D_PRODUCT_LINE}}

.github/workflows/release.yml

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,14 @@ env:
1616
jobs:
1717
build:
1818
name: "Build"
19-
runs-on: [macos-latest]
19+
runs-on: [macOS]
2020
steps:
2121
- name: 📄 Checkout repository
2222
uses: actions/checkout@v5
2323
with:
2424
lfs: true
2525
# Disabling shallow clone is recommended for improving relevancy of reporting
2626
fetch-depth: 0
27-
28-
- name: Checkout build4d-action
29-
uses: actions/checkout@v5
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@v5
37-
with:
38-
repository: 4d/tool4d-action
39-
token: ${{ secrets.GH_4D_ACTION_TOKEN }}
40-
path: .github/actions/tool4d-action
41-
42-
4327
- name: Extract version
4428
run: |
4529
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
@@ -50,31 +34,30 @@ jobs:
5034
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSION" "${GITHUB_WORKSPACE}/${{ github.event.repository.name }}/Info.plist"
5135
cat "${GITHUB_WORKSPACE}/${{ github.event.repository.name }}/Info.plist"
5236
53-
5437
- name: 🏗️ Build ${{ github.event.repository.name }}
55-
uses: ./.github/actions/build4d-action
38+
uses: 4d/build4d-action@main
5639
with:
5740
project: ${{ github.workspace }}/${{ github.event.repository.name }}/Project/${{ github.event.repository.name }}.4DProject
5841
product-line: ${{env.TOOL4D_PRODUCT_LINE}}
5942
version: ${{env.TOOL4D_VERSION}}
60-
targets : all
61-
#actions: "build,pack,sign,archive"
62-
actions: "build,pack,archive"
6343
build: ${{env.TOOL4D_BUILDNUMBER}}
6444
token: ${{ secrets.TOOL4D_DL_TOKEN }}
45+
targets : all
46+
actions: "clean,build,pack,sign,archive"
47+
sign-certificate: "Developer ID Application: 4D"
48+
sign-as-bundle: true
6549
ignore-warnings: true
6650

67-
68-
#- name: Notarize
69-
# run: |
70-
# xcrun notarytool submit "${{ github.event.repository.name }}/build/${{ github.event.repository.name }}.zip" --keychain-profile "notary" --wait >> notary_tool.log
71-
# if grep -r "status: Accepted" "notary_tool.log"; then
72-
# echo "Notarize Success"
73-
# exit 0
74-
# else
75-
# echo "Notarize Failed"
76-
# exit 1
77-
# fi
51+
- name: Notarize
52+
run: |
53+
xcrun notarytool submit "${{ github.event.repository.name }}/build/${{ github.event.repository.name }}.zip" --keychain-profile "notary4d" --wait >> notary_tool.log
54+
if grep -r "status: Accepted" "notary_tool.log"; then
55+
echo "Notarize Success"
56+
exit 0
57+
else
58+
echo "Notarize Failed"
59+
exit 1
60+
fi
7861
7962
- name: Upload Artifact
8063
if: github.event_name != 'pull_request'

0 commit comments

Comments
 (0)