Skip to content

build

build #580

Workflow file for this run

name: build
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
build:
name: build
runs-on: macos-ventura
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
submodules: recursive
fetch-depth: 0
lfs: true
- name: Build, test, and release
env:
DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64: ${{ secrets.DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64 }}
DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD: ${{ secrets.DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD }}
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER_ID: ${{ secrets.APPLE_API_KEY_ISSUER_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE: ${{ github.ref == 'refs/heads/main' }}
run: |
Scripts/bootstrap.sh Scripts/build.sh
- name: Archive the build directory
uses: actions/upload-artifact@v3
with:
path: build
if-no-files-found: error
documentation:
needs: build
runs-on: macos-13
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
submodules: recursive
fetch-depth: 0
lfs: true
- name: Download the build artifacts
uses: actions/download-artifact@master
with:
path: build
- name: Build the site
run: |
pushd build
unzip artifact/incontext-*.zip
popd
build/incontext build --site docs
mv docs/build/files _site
- name: Fix permissions
run: |
chmod -v -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
deploy:
needs: documentation
if: ${{ github.ref == 'refs/heads/main' }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
update-homebrew:
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: Update Homebrew formula
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets._GITHUB_ACCESS_TOKEN }}
repository: inseven/homebrew-incontext
event-type: update