Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
miyako committed Nov 29, 2024
1 parent c72611a commit 5109c9c
Show file tree
Hide file tree
Showing 294 changed files with 6,875 additions and 0 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Publish

on:
push:
branches:
- main
paths:
- '*/Project/Sources/**/*.4dm'
- '*/Project/Sources/*/*.4DForm'
- '*/Project/Sources/*.4DCatalog'
- '*/Project/Resources/**'
workflow_dispatch:
inputs:
mode:
type: choice
description: semantic versioning
options:
- patch
- minor
- major
required: true

env:
project_path: cpdf/Project/cpdf.4DProject

jobs:

publish:
permissions: write-all
runs-on: [macos-latest]
steps:

- name: configure
id: configure
run: |
if [ "${mode}" = "" ]; then
echo "mode=patch" >> $GITHUB_OUTPUT
else
echo "mode=${mode}" >> $GITHUB_OUTPUT
fi
echo "project_path=${GITHUB_WORKSPACE}/${project_path}" >> $GITHUB_OUTPUT
shell: bash
env:
mode: ${{ inputs.mode }}

- 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 }}

- 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 }}
68 changes: 68 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Run Tests

on:
push:
branches:
- main
paths:
- '*/Project/Sources/**/*.4dm'
- '*/Project/Sources/*/*.4DForm'
- '*/Project/Sources/*.4DCatalog'
workflow_dispatch:
workflow_call:

env:
project_path: cpdf/Project/cpdf.4DProject
startup_method: test
skip_onstartup: true
create_data: false
dataless: true
data: ''

jobs:

test:
strategy:
fail-fast: false
matrix:
TOOL4D_PLATFORM: ["windows-latest", "macos-latest"]
TOOL4D_BRANCH: [20.x]
TOOL4D_VERSION: [20.5]
TOOL4D_BUILD: [latest]
runs-on: ${{ matrix.TOOL4D_PLATFORM }}

steps:

- name: checkout
uses: actions/checkout@v4

- name: get tool4d
id: get
uses: miyako/4D/.github/actions/tool4d-download@v1
with:
platform: ${{ matrix.TOOL4D_PLATFORM }}
branch: ${{ matrix.TOOL4D_BRANCH }}
version: ${{ matrix.TOOL4D_VERSION }}
build: ${{ matrix.TOOL4D_BUILD }}

- name: run tests
id: tests
uses: miyako/4D/.github/actions/tool4d-execute@v1
with:
tool4d_executable_path: ${{ steps.get.outputs.tool4d_executable_path }}
project_path: ${{ env.project_path }}
startup_method: ${{ env.startup_method }}
skip_onstartup: ${{ env.skip_onstartup }}
create_data: ${{ env.create_data }}
dataless: ${{ env.dataless }}
data: ${{ env.data }}

- name: print results
run: |
echo "stderr: ${stderr}"
if [[ "${stderr}" == *failed ]]; then
echo "failed"; exit 1
fi
env:
stderr: ${{ steps.tests.outputs.stderr }}
shell: bash
47 changes: 47 additions & 0 deletions .github/workflows/test-build-component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test - Build Component

on:
workflow_dispatch:

jobs:

test:
runs-on: [macos-latest]
steps:

- name: checkout
uses: actions/checkout@v4

- name: setup
id: setup
run: |
echo "project_path=${GITHUB_WORKSPACE}/example/Project/example.4DProject" >> $GITHUB_OUTPUT
- 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.setup.outputs.project_path }}

- name: print result
run: |
echo "project_path: ${project_path}"
echo "product_path: ${product_path}"
ls .
env:
project_path: ${{ steps.setup.outputs.project_path }}
product_path: ${{ steps.build.outputs.product_path }}
41 changes: 41 additions & 0 deletions .github/workflows/test-create-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test - Create Assets

on:
workflow_dispatch:

jobs:

test:
permissions: write-all
runs-on: [macos-latest]
steps:

- name: setup
id: setup
run: |
echo dmg_path="${GITHUB_WORKSPACE}/example.dmg" >> ${GITHUB_OUTPUT}
echo zip_path="${GITHUB_WORKSPACE}/example.zip" >> ${GITHUB_OUTPUT}
- name: download dmg
run: |
curl "https://github.com/miyako/4d-template-component-cicd/releases/download/patch-0.0.2/example.dmg" -o "${dmg_path}" -sL
env:
dmg_path: ${{ steps.setup.outputs.dmg_path }}

- name: create
id: create
uses: miyako/4D/.github/actions/deployment-create-zip@v1
with:
dmg_path: ${{ steps.setup.outputs.dmg_path }}
zip_path: ${{ steps.setup.outputs.zip_path }}

- name: upload assets
id: upload
uses: miyako/4D/.github/actions/deployment-release-assets@v1
with:
dmg_path: ${{ steps.setup.outputs.dmg_path }}
zip_path: ${{ steps.setup.outputs.zip_path }}
tag_name: "test"
release_name: "test"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/test-dmg-to-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test - Disk Image To Zip

on:
workflow_dispatch:

jobs:

test:
runs-on: [macos-latest]
steps:

- name: setup
id: setup
run: |
echo dmg_path="${GITHUB_WORKSPACE}/example.dmg" >> ${GITHUB_OUTPUT}
echo zip_path="${GITHUB_WORKSPACE}/example.zip" >> ${GITHUB_OUTPUT}
- name: download dmg
run: |
curl "https://github.com/miyako/4d-template-component-cicd/releases/download/patch-0.0.2/example.dmg" -o "${dmg_path}" -sL
env:
dmg_path: ${{ steps.setup.outputs.dmg_path }}

- name: create
id: create
uses: miyako/4D/.github/actions/deployment-create-zip@v1
with:
dmg_path: ${{ steps.setup.outputs.dmg_path }}
zip_path: ${{ steps.setup.outputs.zip_path }}

- name: print result
run: |
ls .
34 changes: 34 additions & 0 deletions .github/workflows/test-package-set-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test - Set Package Version

on:
workflow_dispatch:
inputs:
mode:
type: choice
description: semantic versioning
options:
- patch
- minor
- major

jobs:

test:
permissions: write-all
runs-on: [ubuntu-latest]
steps:

- name: checkout
uses: actions/checkout@v4

- name: set version
id: set
uses: miyako/4D/.github/actions/package-set-version@v1
with:
mode: ${{ inputs.mode }}

- name: print result
run: |
echo "version: ${version}"
env:
version: ${{ steps.set.outputs.version }}
Loading

0 comments on commit 5109c9c

Please sign in to comment.