diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18e1d9c6f..b6821e544 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: container project - PR/merge build -on: +on: pull_request: types: [opened, reopened, synchronize] push: @@ -8,7 +8,7 @@ on: - main - release/* -jobs: +jobs: build: name: Invoke build uses: ./.github/workflows/common.yml diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index b439222b2..70cc604b1 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -1,15 +1,15 @@ name: container project - common jobs -on: +on: workflow_call: inputs: release: - type: boolean + type: boolean description: "Publish this build for release" default: false jobs: - buildAndTest: + buildAndTest: name: Build and test the project timeout-minutes: 30 runs-on: [self-hosted, macos, sequoia, ARM64] @@ -18,40 +18,40 @@ jobs: packages: read steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Update containerization - run: | + run: | /usr/bin/swift package update containerization - name: Check formatting - run: | + run: | ./scripts/install-hawkeye.sh make fmt - if ! git diff --quiet -- . ':(exclude)Package.swift' ':(exclude)Package.resolved'; then echo "The following files require formatting or license header updates:\n$(git diff --name-only)" ; false ; fi - - name: Check protobuf - run: | - make protos + if ! git diff --quiet -- . ':(exclude)Package.swift' ':(exclude)Package.resolved'; then echo "The following files require formatting or license header updates:\n$(git diff --name-only)" ; false ; fi + - name: Check protobuf + run: | + make protos # TODO [launch]: TEMPORARILY we need to exclude these files since we had to modify them to add - # the github token for pulling the private repos. - if ! git diff --quiet -- . ':(exclude)Package.swift' ':(exclude)Package.resolved' ':(exclude)Protobuf.Makefile'; then echo "The following files require formatting or license header updates:\n$(git diff --name-only)" ; false ; fi + # the github token for pulling the private repos. + if ! git diff --quiet -- . ':(exclude)Package.swift' ':(exclude)Package.resolved' ':(exclude)Protobuf.Makefile'; then echo "The following files require formatting or license header updates:\n$(git diff --name-only)" ; false ; fi env: CURRENT_SDK: y - name: Set build configuration run: | echo "BUILD_CONFIGURATION=debug" >> $GITHUB_ENV - if [ ${{ inputs.release }} == true ]; then + if [ ${{ inputs.release }} == true ]; then echo "BUILD_CONFIGURATION=release" >> $GITHUB_ENV fi - name: Make the container project and docs - run: | + run: | make container dsym docs tar cfz _site.tgz _site env: DEVELOPER_DIR: "/Applications/Xcode_16.3.app/Contents/Developer" CURRENT_SDK: y - - name: Create package + - name: Create package run: | mkdir -p outputs mv bin/${{ env.BUILD_CONFIGURATION }}/container-installer-unsigned.pkg outputs diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index 8cfb0ec2a..68a19854d 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -1,15 +1,15 @@ -# Manual workflow for releasing docs ad-hoc. Workflow can only be run for main or release branches. +# Manual workflow for releasing docs ad-hoc. Workflow can only be run for main or release branches. # Workflow does NOT publish a release of container. name: Deploy application website -on: +on: workflow_dispatch: -jobs: +jobs: checkBranch: runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/release') steps: - - name: Branch validation + - name: Branch validation run: echo "Branch ${{ github.ref_name }} is allowed" buildSite: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 449007b90..98e7a9cbc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,15 @@ name: container project - release build -on: - push: +on: + push: tags: - "[0-9]+.[0-9]+.[0-9]+" -jobs: +jobs: build: name: Invoke build and release uses: ./.github/workflows/common.yml - with: + with: release: true secrets: inherit permissions: