add timestamp #135
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: build | |
on: | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- master | |
- develop | |
pull_request: | |
branches: | |
- master | |
- develop | |
jobs: | |
build: | |
runs-on: macos-latest | |
permissions: | |
id-token: write | |
contents: write | |
attestations: write | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
- name: Get the configuration | |
id: get_configuration | |
run: | | |
[ $(echo ${{ github.ref }} | cut -d / -f 2) = "tags" ] && echo "configuration=Release" >> $GITHUB_OUTPUT || echo "configuration=Debug" >> $GITHUB_OUTPUT | |
- name: Install the Apple certificate and provisioning profile | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
# create variables | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
# import certificate and provisioning profile from secrets | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
# create temporary keychain | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
# import certificate to keychain | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.APPLE_ID }}" --team-id "96QY9UPB32" --password "${{ secrets.APPLE_ID_APP_SPECIFIC_PASSWORD }}" | |
- name: build | |
run: xcodebuild clean build -configuration ${{ steps.get_configuration.outputs.configuration }} | |
- name: Stage Artifact | |
run: | | |
cd build/${{ steps.get_configuration.outputs.configuration }} && \ | |
zip -r Polyhedra.saver.zip Polyhedra.saver && \ | |
shasum -a 256 Polyhedra.saver.zip | |
- name: Sign zip | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
cd build/${{ steps.get_configuration.outputs.configuration }} && \ | |
xcrun notarytool submit Polyhedra.saver.zip --keychain-profile "notarytool-profile" --verbose --wait | |
- name: Get hash | |
run: | | |
shasum -a 256 build/${{ steps.get_configuration.outputs.configuration }}/Polyhedra.saver.zip | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: false | |
generate_release_notes: true | |
files: build/${{ steps.get_configuration.outputs.configuration }}/Polyhedra.saver.zip | |
- name: Attest | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: build/${{ steps.get_configuration.outputs.configuration }}/Polyhedra.saver.zip | |
- name: Upload Artifact | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PolyhedraSaver-${{ github.sha }} | |
path: | | |
build/${{ steps.get_configuration.outputs.configuration }}/ | |
!**/*.zip |