Nightly builds fix #104
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Build | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
#Reuse ci.yml workflow on main branch and upload artifacts to release page | |
reuse_main_ci: | |
uses: ./.github/workflows/ci.yml | |
secrets: inherit | |
upload_nighly_builds: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest] | |
python-version: [ 3.11 ] | |
needs: reuse_main_ci | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Retrieve saved artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: installers/dist | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: installers/dist | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Sign executable and create dmg (OSX) | |
env: | |
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | |
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} | |
run: | | |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 | |
security create-keychain -p DloaAcYP build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p DloaAcYP build.keychain | |
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k DloaAcYP build.keychain | |
hdiutil attach installers/dist/SasView-Installer-macos-*/SasView5.dmg | |
cp -rf /Volumes/SasView5/SasView5.app installers/dist | |
cd installers/dist | |
python ../../build_tools/code_sign_osx.py | |
codesign --verify --options=runtime --entitlements ../../build_tools/entitlements.plist --timestamp --deep --verbose=4 --force --sign "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView5.app | |
hdiutil create SasView5.dmg -srcfolder SasView5.app -ov -format UDZO | |
codesign -s "Developer ID Application: European Spallation Source Eric (W2AG9MPZ43)" SasView5.dmg | |
#This GH action will need to be replaced soon as altool will be deprecated late 2023 | |
- name: Notarize Release Build (OSX) | |
uses: GuillaumeFalourd/xcode-notarize@v1 | |
with: | |
product-path: "installers/dist/SasView5.dmg" | |
primary-bundle-id: "org.sasview.SasView5" | |
appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }} | |
appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} | |
verbose: True | |
- name: Staple Release Build (OSX) | |
uses: BoundfoxStudios/action-xcode-staple@v1 | |
with: | |
product-path: "installers/dist/SasView5.dmg" | |
- name: Rename artifacts | |
run: | | |
mv installers/dist/SasView-Installer-windows-*/setupSasView.exe installers/dist/setupSasView-nightly-Win64.exe | |
mv installers/dist/SasView-Installer-macos-*/SasView5.dmg installers/dist/SasView-nightly-MacOSX.dmg | |
mv installers/dist/SasView-Installer-ubuntu-*/sasview5.tar.gz installers/dist/SasView-nightly-Linux.tar.gz | |
- name: Upload Nightly Build Installer to GitHub releases | |
uses: ncipollo/release-action@v1 | |
with: | |
draft: false | |
prerelease: true | |
allowUpdates: true | |
replacesArtifacts: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "installers/dist/setupSasView-nightly-Win64.exe, installers/dist/SasView-nightly-MacOSX.dmg, installers/dist/SasView-nightly-Linux.tar.gz" | |
body: "Nightly build of main SasView branch" | |
name: "nightly-build" | |
tag: "nightly-build" |