Bump actions/checkout from 6 to 7 #218
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: Build from Glyphs | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["*"] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| release: | |
| # A release, pre-release, or draft of a release was published | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout ${{ github.head_ref || github.ref_name }} | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: .github/python-version.txt | |
| cache: pip | |
| - name: Build variable fonts | |
| run: make build | |
| - name: Build Android fonts | |
| run: make android | |
| - name: Generate artifact name | |
| id: zip-name | |
| uses: alpha-tango-kilo/gha-artifact-name@v1 | |
| with: | |
| repo-name: Google Sans Code | |
| overrides: | | |
| build-test: build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ steps.zip-name.outputs.artifact-name }} | |
| path: | | |
| fonts/ | |
| outputs: | |
| artifact-name: ${{ steps.zip-name.outputs.artifact-name }} | |
| tests: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| needs: | |
| - build | |
| steps: | |
| - name: Checkout ${{ github.head_ref || github.ref_name }} | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| - name: Download built fonts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ needs.build.outputs.artifact-name }} | |
| path: fonts | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: .github/python-version.txt | |
| cache: pip | |
| - name: OpenType Sanitizer checks | |
| uses: f-actions/opentype-sanitizer@v3 | |
| with: | |
| path: fonts/**/*.ttf | |
| - name: Shaperglot report | |
| run: | | |
| echo "::group::Set up venv" | |
| python -m venv shaperglot-venv | |
| shaperglot-venv/bin/pip install --upgrade shaperglot | |
| echo "::endgroup::" | |
| shaperglot-venv/bin/shaperglot report fonts/variable/GoogleSansCode[MONO,wght].ttf | |
| - name: Run Fontbakery | |
| id: fontbakery | |
| run: | | |
| mkdir -p venv | |
| touch venv/touchfile build.stamp | |
| make test | |
| - name: Upload Fontbakery report(s) | |
| uses: actions/upload-artifact@v7 | |
| # Always upload reports (even during a pipeline fail), so long as Fontbakery completed | |
| if: ${{ !cancelled() && (steps.fontbakery.conclusion == 'success' || steps.fontbakery.conclusion == 'failure') }} | |
| with: | |
| name: Fontbakery reports | |
| path: out/fontbakery | |
| release: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 5 | |
| needs: | |
| - build | |
| - tests | |
| # Only run on a GitHub release | |
| if: github.event_name == 'release' | |
| permissions: | |
| # Needed for svenstaro/upload-release-action | |
| contents: write | |
| steps: | |
| - name: Checkout ${{ github.head_ref || github.ref_name }} | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| - name: Download built fonts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ needs.build.outputs.artifact-name }} | |
| - name: Create release archives | |
| run: | | |
| cp "$GITHUB_WORKSPACE/OFL.txt" "$GITHUB_WORKSPACE/variable" | |
| cd "$GITHUB_WORKSPACE/variable" \ | |
| && zip "../GoogleSansCode-${GITHUB_REF#refs/*/}.zip" OFL.txt *.ttf | |
| cp "$GITHUB_WORKSPACE/OFL.txt" "$GITHUB_WORKSPACE/android" | |
| cd "$GITHUB_WORKSPACE/android" \ | |
| && zip "../GoogleSansCode-Android-${GITHUB_REF#refs/*/}.zip" OFL.txt *.ttf | |
| - name: Upload binaries to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: GoogleSansCode*.zip | |
| file_glob: true | |
| asset_name: ${{ env.RELEASE_ZIP_NAME }} | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| body: > | |
| Production ready fonts. | |
| See [CHANGELOG.md](https://github.com/googlefonts/googlesans-code/blob/main/CHANGELOG.md) for changes |