kopia lustrzana https://github.com/jameshball/osci-render
Simplify build.yaml significantly
rodzic
ee99ff1afc
commit
0274bd1492
|
@ -5,19 +5,20 @@ on:
|
||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build:
|
||||||
name: Build Linux
|
name: Build (${{ matrix.project }} ${{ matrix.version }} @ ${{ matrix.os }})
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
os: [ubuntu-24.04, macos-latest, windows-latest]
|
||||||
- project: osci-render
|
project: [osci-render, sosci]
|
||||||
version: free
|
version: [free, premium]
|
||||||
- project: osci-render
|
exclude:
|
||||||
version: premium
|
|
||||||
- project: sosci
|
- project: sosci
|
||||||
version: premium
|
version: free
|
||||||
steps:
|
steps:
|
||||||
- name: Fix up git URLs
|
- name: Fix up git URLs
|
||||||
run: echo -e '[url "https://github.com/"]\n insteadOf = "git@github.com:"' >> ~/.gitconfig
|
run: echo -e '[url "https://github.com/"]\n insteadOf = "git@github.com:"' >> ~/.gitconfig
|
||||||
|
@ -28,47 +29,28 @@ jobs:
|
||||||
token: ${{ secrets.ACCESS_TOKEN }}
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: "Run script"
|
- name: Set platform variables
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export OS="linux"
|
if [[ "${{ matrix.os }}" == ubuntu* ]]; then
|
||||||
source ./ci/setup-env.sh
|
echo "OS=linux" >> $GITHUB_ENV
|
||||||
source ./ci/test.sh
|
echo "OS_ARTIFACT=linux" >> $GITHUB_ENV
|
||||||
source ./ci/build.sh "${{ matrix.project }}" "${{ matrix.version }}"
|
elif [[ "${{ matrix.os }}" == macos* ]]; then
|
||||||
shell: bash
|
echo "OS=mac" >> $GITHUB_ENV
|
||||||
|
echo "OS_ARTIFACT=macos" >> $GITHUB_ENV
|
||||||
- name: Upload Artifact
|
else
|
||||||
uses: actions/upload-artifact@v4
|
echo "OS=win" >> $GITHUB_ENV
|
||||||
with:
|
echo "OS_ARTIFACT=windows" >> $GITHUB_ENV
|
||||||
name: "${{ matrix.project }}-${{ matrix.version }}-linux"
|
fi
|
||||||
path: bin
|
|
||||||
retention-days: 7
|
|
||||||
build-macos:
|
|
||||||
name: Build macOS
|
|
||||||
runs-on: macos-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- project: osci-render
|
|
||||||
version: free
|
|
||||||
- project: osci-render
|
|
||||||
version: premium
|
|
||||||
- project: sosci
|
|
||||||
version: premium
|
|
||||||
steps:
|
|
||||||
- name: Fix up git URLs
|
|
||||||
run: echo -e '[url "https://github.com/"]\n insteadOf = "git@github.com:"' >> ~/.gitconfig
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.ACCESS_TOKEN }}
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
|
# macOS specific: setup Xcode and import certificates
|
||||||
- uses: maxim-lobanov/setup-xcode@v1
|
- uses: maxim-lobanov/setup-xcode@v1
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
with:
|
with:
|
||||||
xcode-version: latest
|
xcode-version: latest
|
||||||
|
|
||||||
- name: Import application certificates
|
- name: Import application certificates
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
uses: apple-actions/import-codesign-certs@v3
|
uses: apple-actions/import-codesign-certs@v3
|
||||||
with:
|
with:
|
||||||
keychain: oscirender
|
keychain: oscirender
|
||||||
|
@ -77,6 +59,7 @@ jobs:
|
||||||
p12-password: ${{ secrets.APPLE_APPLICATION_CERTIFICATE_PASSWORD }}
|
p12-password: ${{ secrets.APPLE_APPLICATION_CERTIFICATE_PASSWORD }}
|
||||||
|
|
||||||
- name: Import installer certificates
|
- name: Import installer certificates
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
uses: apple-actions/import-codesign-certs@v3
|
uses: apple-actions/import-codesign-certs@v3
|
||||||
with:
|
with:
|
||||||
keychain: oscirender
|
keychain: oscirender
|
||||||
|
@ -85,32 +68,47 @@ jobs:
|
||||||
p12-password: ${{ secrets.APPLE_INSTALLER_CERTIFICATE_PASSWORD }}
|
p12-password: ${{ secrets.APPLE_INSTALLER_CERTIFICATE_PASSWORD }}
|
||||||
create-keychain: false
|
create-keychain: false
|
||||||
|
|
||||||
- name: "Run script"
|
# Windows specific: NuGet setup
|
||||||
|
- name: Setup NuGet.exe for use with actions
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
uses: NuGet/setup-nuget@v1.0.5
|
||||||
|
|
||||||
|
- name: NuGet Sources
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: nuget sources
|
||||||
|
|
||||||
|
- name: Run build & tests
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export OS="mac"
|
|
||||||
source ./ci/setup-env.sh
|
source ./ci/setup-env.sh
|
||||||
source ./ci/test.sh
|
source ./ci/test.sh
|
||||||
source ./ci/build.sh "${{ matrix.project }}" "${{ matrix.version }}"
|
source ./ci/build.sh "${{ matrix.project }}" "${{ matrix.version }}"
|
||||||
shell: bash
|
|
||||||
|
|
||||||
|
# macOS packaging & notarization
|
||||||
- name: Download Packages installer build tool
|
- name: Download Packages installer build tool
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
run: wget http://s.sudre.free.fr/files/Packages_1211_dev.dmg
|
run: wget http://s.sudre.free.fr/files/Packages_1211_dev.dmg
|
||||||
|
|
||||||
- name: Mount Packages image
|
- name: Mount Packages image
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
run: hdiutil attach Packages_1211_dev.dmg
|
run: hdiutil attach Packages_1211_dev.dmg
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
run: sudo installer -pkg /Volumes/Packages\ 1.2.11/Install\ Packages.pkg -target /
|
run: sudo installer -pkg /Volumes/Packages\ 1.2.11/Install\ Packages.pkg -target /
|
||||||
|
|
||||||
- name: Build installer
|
- name: Build installer (macOS pkg)
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
run: packagesbuild --project "packaging/${{ matrix.project }}.pkgproj"
|
run: packagesbuild --project "packaging/${{ matrix.project }}.pkgproj"
|
||||||
|
|
||||||
- name: Sign installer
|
- name: Sign installer (macOS pkg)
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
productsign -s "${{ secrets.APPLE_DEVELOPER_ID_INSTALLER }}" "packaging/build/${{ matrix.project }}.pkg" "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
productsign -s "${{ secrets.APPLE_DEVELOPER_ID_INSTALLER }}" "packaging/build/${{ matrix.project }}.pkg" "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
||||||
pkgutil --check-signature "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
pkgutil --check-signature "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
||||||
|
|
||||||
- name: Notarize installer
|
- name: Notarize installer (macOS)
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
uses: lando/notarize-action@v2
|
uses: lando/notarize-action@v2
|
||||||
with:
|
with:
|
||||||
product-path: "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
product-path: "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
||||||
|
@ -121,65 +119,29 @@ jobs:
|
||||||
tool: notarytool
|
tool: notarytool
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
||||||
- name: Staple installer
|
- name: Staple installer (macOS)
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
run: xcrun stapler staple "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
run: xcrun stapler staple "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
||||||
|
|
||||||
- name: Check installer
|
- name: Check installer (macOS)
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
run: spctl -a -vvv -t install "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
run: spctl -a -vvv -t install "bin/${{ matrix.project }}-${{ matrix.version }}.pkg"
|
||||||
|
|
||||||
- name: Upload Artifact
|
# Windows packaging (Inno Setup)
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: "${{ matrix.project }}-${{ matrix.version }}-macos"
|
|
||||||
path: bin
|
|
||||||
retention-days: 7
|
|
||||||
build-windows:
|
|
||||||
name: Build Windows
|
|
||||||
runs-on: windows-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- project: osci-render
|
|
||||||
version: free
|
|
||||||
- project: osci-render
|
|
||||||
version: premium
|
|
||||||
- project: sosci
|
|
||||||
version: premium
|
|
||||||
steps:
|
|
||||||
- name: Fix up git URLs
|
|
||||||
run: echo -e '[url "https://github.com/"]\n insteadOf = "git@github.com:"' >> ~/.gitconfig
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.ACCESS_TOKEN }}
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Setup NuGet.exe for use with actions
|
|
||||||
uses: NuGet/setup-nuget@v1.0.5
|
|
||||||
|
|
||||||
- name: NuGet Sources
|
|
||||||
run: nuget sources
|
|
||||||
|
|
||||||
- name: "Run script"
|
|
||||||
run: |
|
|
||||||
export OS="win"
|
|
||||||
source ./ci/setup-env.sh
|
|
||||||
source ./ci/test.sh
|
|
||||||
source ./ci/build.sh "${{ matrix.project }}" "${{ matrix.version }}"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compile .ISS to .EXE Installer
|
- name: Compile .ISS to .EXE Installer
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
|
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
|
||||||
with:
|
with:
|
||||||
path: "packaging/${{ matrix.project }}.iss"
|
path: "packaging/${{ matrix.project }}.iss"
|
||||||
|
|
||||||
- name: Move installer to bin
|
- name: Move installer to bin (Windows)
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
shell: bash
|
||||||
run: mv "packaging/build/${{ matrix.project }}.exe" "bin/${{ matrix.project }}-${{ matrix.version }}.exe"
|
run: mv "packaging/build/${{ matrix.project }}.exe" "bin/${{ matrix.project }}-${{ matrix.version }}.exe"
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: "${{ matrix.project }}-${{ matrix.version }}-windows"
|
name: "${{ matrix.project }}-${{ matrix.version }}-${{ env.OS_ARTIFACT }}"
|
||||||
path: bin
|
path: bin
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
Ładowanie…
Reference in New Issue