stable-macos #55
This file contains hidden or 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: stable-macos | |
on: | |
workflow_dispatch: | |
inputs: | |
force_version: | |
type: boolean | |
description: Force update version | |
generate_assets: | |
type: boolean | |
description: Generate assets | |
checkout_pr: | |
type: string | |
description: Checkout PR | |
repository_dispatch: | |
types: [stable] | |
push: | |
branches: [cs-master] | |
paths-ignore: | |
- "**/*.md" | |
pull_request: | |
branches: [cs-master] | |
paths-ignore: | |
- "**/*.md" | |
env: | |
APP_NAME: Void | |
ASSETS_REPOSITORY: ${{ github.repository_owner }}/binaries | |
OS_NAME: osx | |
VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions | |
VSCODE_QUALITY: stable | |
NEW_RELEASE: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.runner }} | |
env: | |
VSCODE_ARCH: ${{ matrix.vscode_arch }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- runner: macos-13 | |
vscode_arch: x64 | |
- runner: macos-14 | |
vscode_arch: arm64 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.GITHUB_BRANCH }} | |
- name: Switch to relevant branch | |
env: | |
PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }} | |
run: . get_pr.sh | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.18.2" | |
- name: Setup Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
if: env.VSCODE_ARCH == 'x64' | |
- name: Clone VSCode repo | |
run: . get_repo.sh # clones the void repo | |
- name: Check PR or cron | |
env: | |
GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }} | |
run: . check_cron_or_pr.sh # exports SHOULD_BUILD and SHOULD_DEPLOY | |
- name: Check existing Void tags/releases | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: . check_tags.sh # exports SHOULD_BUILD=true and SHOULD_DEPLOY=true, and SHOULD_BUILD_TAR=true, etc | |
if: env.SHOULD_DEPLOY == 'yes' | |
- name: Build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./build.sh # builds vscode/ folder (void repo) | |
if: env.SHOULD_BUILD == 'yes' | |
- name: Prepare assets # turns the build into .app, .dmg, .zip, .sha1, .sha256, etc, all the assets | |
env: | |
CERTIFICATE_OSX_APP_PASSWORD: ${{ secrets.APPSTORE_CONNECT_PASSWORD }} | |
CERTIFICATE_OSX_ID: ${{ secrets.APPSTORE_CONNECT_USERNAME }} | |
CERTIFICATE_OSX_P12_DATA: ${{ secrets.CERTIFICATE_OSX_P12 }} | |
CERTIFICATE_OSX_P12_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }} | |
CERTIFICATE_OSX_TEAM_ID: ${{ secrets.APPSTORE_CONNECT_TEAM_ID }} | |
run: ./prepare_assets.sh | |
if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true') | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.BINARIES_RELEASE_PAT }} | |
run: ./release.sh # creates the github release in binaries/ (ASSETS_REPOSITORY = "binaries") | |
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' | |
- name: Update versions repo | |
env: | |
FORCE_UPDATE: ${{ github.event.inputs.force_version }} | |
GITHUB_TOKEN: ${{ secrets.BINARIES_RELEASE_PAT }} | |
GITHUB_USERNAME: ${{ github.repository_owner }} | |
run: ./update_version.sh | |
# ASSET_NAME = VSCode-darwin-arm64.exe or whatever | |
# RELEASE_VERSION = voidVersion.date, eg 1.0.3.2025102454 | |
# BUILD_SOURCEVERSION = checksum(RELEASE_VERSION) | |
# creates a JSON with these fields: | |
# sha1 = "assets/${ASSET_NAME}.sha1" | |
# sha256 = "assets/${ASSET_NAME}.sha256" | |
# url = (URL to the binary of this asset on github) | |
# name = "${RELEASE_VERSION}" | |
# version = "${BUILD_SOURCEVERSION}" | |
# productVersion = "${RELEASE_VERSION}" | |
# timestamp = now() | |
if: env.SHOULD_DEPLOY == 'yes' | |
- name: Upload assets # Void - does not typically run - only happens if not deploying but only building so we have a place to get the built assets from | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bin-${{ matrix.vscode_arch }} | |
path: assets/ | |
retention-days: 3 | |
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true' | |
- name: Clean up keychain | |
if: always() | |
run: | | |
KEYCHAIN=$RUNNER_TEMP/build.keychain | |
if [ -f "$KEYCHAIN" ]; | |
then | |
security delete-keychain $KEYCHAIN | |
fi |