Skip to content

Commit

Permalink
Merge branch '42-github-actions-preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
Aszusz committed Mar 27, 2024
2 parents 3077092 + a3044f7 commit 0ee83db
Show file tree
Hide file tree
Showing 13 changed files with 691 additions and 728 deletions.
94 changes: 91 additions & 3 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:
required: true
type: string

env:
app_name: ${{ inputs.env == 'production' && 'MoonshineSDKInstaller' || 'MoonshineSDKInstallerDevelopment' }}

jobs:
build:
runs-on: "macos-latest"
Expand All @@ -47,6 +50,91 @@ jobs:
flex-version: "4.16.1"
air-version: "33.1"
accept-air-license: true

- name: Build with Ant
run: ant -noinput -buildfile 'MoonshineSDKInstaller/build/build.xml'
air-license-base64: ${{ secrets.AIR_LICENSE_BASE64 }}

# Prepare signing

- name: Check for Keychain
id: check_keychain
shell: bash
run: |
if security list-keychains | grep -q "build.keychain"; then
echo "keychain_exists=true" >> $GITHUB_OUTPUT
else
echo "keychain_exists=false" >> $GITHUB_OUTPUT
fi
- name: Create keychain
if: steps.check_keychain.outputs.keychain_exists == 'false'
shell: bash
run: |
security create-keychain -p "${{ secrets.MAC_KEYCHAIN_PASS }}" build.keychain
echo "Keychain created"
security set-keychain-settings -lut 21600 build.keychain
echo "Keychain settings set"
security default-keychain -s build.keychain
echo "Keychain made default"
security unlock-keychain -p "${{ secrets.MAC_KEYCHAIN_PASS }}" build.keychain
echo "Keychain unlocked"
- name: Import certificates
shell: bash
run: |
echo "${{ secrets.MAC_APPLICATION_CERTKEY }}" | base64 --decode > application_certkey.p12
echo "${{ secrets.MAC_INSTALLER_CERTKEY }}" | base64 --decode > installer_certkey.p12
security import ./application_certkey.p12 \
-k build.keychain \
-f pkcs12 \
-P "${{ secrets.MAC_CERTKEY_PASS }}" \
-T /usr/bin/codesign \
-T /usr/bin/productsign \
-T /usr/bin/productbuild
security import ./installer_certkey.p12 \
-k build.keychain \
-f pkcs12 \
-P "${{ secrets.MAC_CERTKEY_PASS }}" \
-T /usr/bin/codesign \
-T /usr/bin/productsign
- name: Allow codesign and productsign to use keychain
shell: bash
run: |
security set-key-partition-list \
-S apple-tool:,apple:,codesign:,productsign: \
-s \
-k "${{ secrets.MAC_KEYCHAIN_PASS }}" \
build.keychain
- name: Unlock keychain
shell: bash
run: |
security unlock-keychain -p "${{ secrets.MAC_KEYCHAIN_PASS }}" build.keychain
- name: Create notarization profile
shell: bash
run: |
xcrun notarytool \
store-credentials "notarytool-profile" \
--apple-id ${{ secrets.MAC_NOTARIZATION_APPLE_ID }} \
--team-id ${{ secrets.MAC_NOTARIZATION_TEAM_ID }} \
--password ${{ secrets.MAC_NOTARIZATION_PASS }}
- name: Build with Ant
run: >
ant
-buildfile MoonshineSDKInstaller/build/build.xml
build pack-and-sign
-Dapp.version=${{ inputs.version }}
-Dbuild.is.development=${{ inputs.env != 'production' }}
-Dbuild.number=${{ github.run_number }}
-Dkeychain.name=build.keychain
-Dnotarytool.profile="notarytool-profile"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: msdki-macos-setup
path: MoonshineSDKInstaller/build/bin/deploy/${{ env.app_name }}-${{ inputs.version }}.pkg
if-no-files-found: error
85 changes: 72 additions & 13 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ on:
description: "A Version"
required: true
type: string
caching:
description: "Use caching"
required: true
type: boolean
default: false

workflow_call:
inputs:
Expand All @@ -30,12 +25,10 @@ on:
description: "A Version"
required: true
type: string
caching:
description: "Use caching"
required: true
type: boolean
default: false

env:
app_name: ${{ inputs.env == 'production' && 'MoonshineSDKInstaller' || 'MoonshineSDKInstallerDevelopment' }}

jobs:
build:
runs-on: "windows-latest"
Expand All @@ -57,6 +50,72 @@ jobs:
flex-version: "4.16.1"
air-version: "33.1"
accept-air-license: true

- name: Build with Ant
run: ant -noinput -buildfile 'MoonshineSDKInstaller/build/build.xml'
air-license-base64: ${{ secrets.AIR_LICENSE_BASE64 }}

- name: Install NSIS plugin nsProcess
working-directory: MoonshineSDKInstaller/build
run: |
Invoke-RestMethod -Uri "https://nsis.sourceforge.io/mediawiki/images/2/2f/ExecCmd.zip" -OutFile ExecCmd.zip
7z x ExecCmd.zip -o'ExecCmd' -y
mv ExecCmd\ExecCmd.dll "C:\Program Files (x86)\NSIS\Plugins\x86-unicode\ExecCmd.dll"
- name: Setup signing certificate
run: |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash

- name: Set signing variables
id: variables
run: |
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
echo "SM_THUMBPRINT=${{ secrets.SM_THUMBPRINT }}" >> "$GITHUB_ENV"
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert One Signing Manager Tools" >> $GITHUB_PATH
shell: bash

- name: Cache smtools
id: cache-smtools
uses: actions/cache@v3
with:
path: smtools-windows-x64.msi
key: smtools-windows

- name: Download smtools
if: ${{ steps.cache-smtools.outputs.cache-hit != 'true' }}
run: |
curl ^
-X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download ^
-H "x-api-key:${{ secrets.SM_API_KEY }}" ^
-o smtools-windows-x64.msi
shell: cmd

- name: Setup SSM KSP for signing
run: |
msiexec /i smtools-windows-x64.msi /quiet /qn
smksp_registrar.exe list
smctl.exe keypair ls
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe
shell: cmd

- name: Build with Ant
shell: cmd
run: >
ant
-buildfile MoonshineSDKInstaller/build/build.xml
build pack-and-sign
-Dapp.version=${{ inputs.version }}
-Dbuild.is.development=${{ inputs.env != 'production' }}
-Dbuild.number=${{ github.run_number }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: msdki-windows-setup
path: MoonshineSDKInstaller/build/bin/deploy/${{ env.app_name }}-${{ inputs.version }}.exe
if-no-files-found: error
26 changes: 0 additions & 26 deletions .github/workflows/build.yml

This file was deleted.

41 changes: 38 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ on:
type: string

env:
app_name: ${{ inputs.env == 'production' && 'MoonshineSDKInstaller' || 'MoonshineSDKInstallerDevelopment' }}
tag: v${{ inputs.version }}${{ inputs.env == 'production' && ' ' || '-Dev' }}

jobs:

build-windows:
name: Build on Windows
uses: moonshine-ide/moonshine-sdk-installer/.github/workflows/build-windows.yml@42-github-actions-slow-refactor
uses: moonshine-ide/moonshine-sdk-installer/.github/workflows/build-windows.yml@master
secrets: inherit
with:
env: ${{ inputs.env }}
version: ${{ inputs.version }}

build-macos:
name: Build on MacOS
uses: moonshine-ide/moonshine-sdk-installer/.github/workflows/build-macos.yml@42-github-actions-slow-refactor
uses: moonshine-ide/moonshine-sdk-installer/.github/workflows/build-macos.yml@master
secrets: inherit
with:
env: ${{ inputs.env }}
Expand All @@ -44,4 +45,38 @@ jobs:
steps:
- name: Print info
run: |
echo "Stub workflow"
echo "Ref: ${{ github.ref_name }}"
echo "Env: ${{ inputs.env }}"
echo "Version: ${{ inputs.version }}"
echo "Tag: ${{ env.tag }}"
- name: Checkout repo
uses: actions/checkout@v4

- name: Download windows installer
uses: actions/download-artifact@v4
with:
name: msdki-windows-setup

- name: Download macos installer
uses: actions/download-artifact@v4
with:
name: msdki-macos-setup

- name: Debug artifacts
run: ls .

- name: Create release
uses: softprops/action-gh-release@v2
with:
name: Moonshine SDK Installer ${{ inputs.version }} ${{ inputs.env == 'production' && ' ' || 'Development' }}
tag_name: ${{ env.tag }}
target_commitish: ${{ github.sha }}
body: |
This is a ${{ inputs.env }} release of MSDKI.
draft: true
prerelease: ${{ inputs.env == 'development' }}
files: |
${{ env.app_name }}-${{ inputs.version }}.exe
${{ env.app_name }}-${{ inputs.version }}.pkg
fail_on_unmatched_files: true
21 changes: 16 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
MoonshineSDKInstaller/bin-debug
MoonshineSDKInstaller/obj/MoonshineSDKInstallerConfig.xml
MoonshineSDKInstallerGUICore/bin/flash/haxe/
InstallerSharedCore/bin
ApacheFlexSDKInstallerLib/obj/
InstallerSharedCore/bin/
InstallerSharedCore/obj/
MoonshineSDKInstaller/build/bin/
MoonshineSDKInstaller/build/helperResources/
MoonshineSDKInstaller/build/images/
MoonshineSDKInstaller/build/installer/
MoonshineSDKInstaller/build/shellScripts/
MoonshineSDKInstaller/obj/
MoonshineSDKInstallerGUICore/bin/
flex-utilities/flex-installer/common/obj/
flex-utilities/flex-installer/installer/obj/
flex-utilities/flex-installer/installerBadge/obj/

local.properties
.DS_Store
.vscode/
.vscode/
30 changes: 0 additions & 30 deletions MoonshineSDKInstaller/build/ApplicationProperties.xml

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 0ee83db

Please sign in to comment.