Skip to content

Bump toitlang/action-macos-sign-notarize from 1.2.1 to 1.3.0 (#23) #71

Bump toitlang/action-macos-sign-notarize from 1.2.1 to 1.3.0 (#23)

Bump toitlang/action-macos-sign-notarize from 1.2.1 to 1.3.0 (#23) #71

Workflow file for this run

name: CI
on:
release:
types: [published]
push:
branches:
- "*"
- "*/*"
workflow_dispatch:
inputs:
# Use 'inputs.<name>' when pasting into a bash `if`, like so:
# if [[ "${{ inputs.strip }}" == 'true' ]]; then ...
#
# When using to guard a step, use 'github.event.inputs.<name>', like so:
# if: ${{ github.event.inputs.<name> == 'true' }}
# or
# if: ${{ github.event.inputs.<name> != 'false' }}
# In the first case, the step will not run if there isn't any workflow dispatch.
# In the second case, the step will run if there isn't any workflow dispatch.
# As such, the recommendation is to use the `== true` if the default is
# false, and the `!= false` if the default is true.
sign-macos:
description: "Sign macOS executables"
required: false
type: boolean
default: false
do-release:
description: "Build release artifacts and upload with this version"
required: false
type: string
default:
env:
TOIT_VERSION: v2.0.0-alpha.174
ACTION_VERSION: ${{ github.event.inputs.do-release || github.event.release.tag_name || '' }}
DO_RELEASE: ${{ github.event_name == 'release' || startsWith(github.event.inputs.do-release, 'v') }}
SIGN_MACOS: ${{ github.event_name == 'release' || github.event.inputs.sign-macos == 'true' }}
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Toit
uses: toitlang/action-setup@v1
with:
toit-version: '${{ env.TOIT_VERSION }}'
- name: Build executables
run: |
make
- name: Upload executables
uses: actions/upload-artifact@v6
with:
name: executables-${{ runner.os }}
path: build
- name: test
run: |
make test
# Check that the README.md wasn't updated.
# We must only change the README.md.in
- name: README check
if: runner.os == 'Linux'
run: |
# Requires the checkout to be not shallow.
BASE_COMMIT=$(git merge-base HEAD origin/main) # Find the original split point.
if ! git diff --quiet $BASE_COMMIT -- README.md; then
echo "::error::README.md on this branch differs from its original base commit."
exit 1
fi
- name: Sign the executable (macOS)
if: env.SIGN_MACOS == 'true' && runner.os == 'macOS'
uses: toitlang/action-macos-sign-notarize@385e50b59cf23df408e3361c28d3d665f4730dd1 # v1.3.0
with:
certificate: ${{ secrets.MACOS_CERTIFICATE }}
certificate-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
username: ${{ secrets.AC_USERNAME }}
password: ${{ secrets.AC_PASSWORD }}
apple-team-id: ${{ vars.MACOS_TEAM_ID }}
app-path: build/server
- name: Sign the executable (Windows)
if: runner.os == 'Windows'
uses: ./
with:
uri: ${{ vars.CERTUM_URI }}
password: ${{ secrets.CERTUM_PWD }}
path: build/server.exe
- name: Prepare release
if: env.DO_RELEASE == 'true' && runner.os != 'Windows'
shell: bash
run: |
mkdir -p release
# tar.gz mac and Linux executables. Zip Windows executables.
if [ ${{ runner.os }} == 'macOS' ]; then
tar -czf release/server-macos.tar.gz -C build server
elif [ ${{ runner.os }} == 'Linux' ]; then
tar -czf release/server-linux.tar.gz -C build server
else
echo "Unknown OS: ${{ runner.os }}"
exit 1
fi
- name: Prepare release (Windows)
if: env.DO_RELEASE == 'true' && runner.os == 'Windows'
shell: pwsh
run: |
mkdir -p release
# Use powershell to zip the Windows executables.
Push-Location build
Compress-Archive -Path server.exe -DestinationPath ../release/server-windows.zip
Pop-Location
- name: Upload release artifacts
if: env.DO_RELEASE == 'true'
uses: actions/upload-artifact@v6
with:
name: release-${{ runner.os }}
path: release
- name: Upload release artifacts as assets
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: release/server*
tag: ${{ github.event.release.tag_name }}
overwrite: true