|
| 1 | +name: Fork release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: [private-build-plans.toml] |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: write |
| 14 | + packages: write |
| 15 | + |
| 16 | +env: |
| 17 | + REGISTRY: ghcr.io |
| 18 | + IMAGE: ghcr.io/${{ github.repository }} |
| 19 | + FONT_NAME: afio |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + if: github.repository != 'awnion/custom-iosevka-nerd-font' |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v6 |
| 27 | + |
| 28 | + - uses: docker/setup-buildx-action@v4 |
| 29 | + |
| 30 | + - uses: docker/login-action@v4 |
| 31 | + with: |
| 32 | + registry: ${{ env.REGISTRY }} |
| 33 | + username: ${{ github.actor }} |
| 34 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + |
| 36 | + - id: sha |
| 37 | + run: echo "short=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" |
| 38 | + |
| 39 | + - id: meta |
| 40 | + uses: docker/metadata-action@v6 |
| 41 | + with: |
| 42 | + images: ${{ env.IMAGE }} |
| 43 | + tags: | |
| 44 | + type=raw,value=sha-${{ steps.sha.outputs.short }} |
| 45 | +
|
| 46 | + - uses: docker/build-push-action@v7 |
| 47 | + with: |
| 48 | + context: . |
| 49 | + push: true |
| 50 | + tags: ${{ steps.meta.outputs.tags }} |
| 51 | + cache-from: type=gha |
| 52 | + cache-to: type=gha,mode=max |
| 53 | + |
| 54 | + - name: Build font |
| 55 | + env: |
| 56 | + IMAGE_REF: ${{ env.IMAGE }}:sha-${{ steps.sha.outputs.short }} |
| 57 | + run: ./build.sh |
| 58 | + |
| 59 | + - name: Create or update latest pre-release |
| 60 | + env: |
| 61 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + run: | |
| 63 | + mv _output/${FONT_NAME}-*.zip "_output/${FONT_NAME}-latest.zip" |
| 64 | +
|
| 65 | + gh release create latest \ |
| 66 | + "_output/${FONT_NAME}-latest.zip" \ |
| 67 | + -R "${{ github.repository }}" \ |
| 68 | + --prerelease \ |
| 69 | + --title "Latest build" \ |
| 70 | + --notes "$(cat <<'NOTES' |
| 71 | + ## Install latest build |
| 72 | +
|
| 73 | + ### Download |
| 74 | +
|
| 75 | + ```bash |
| 76 | + curl -fsSLO https://github.com/${{ github.repository }}/releases/download/latest/${FONT_NAME}-latest.zip |
| 77 | + ``` |
| 78 | +
|
| 79 | + ### Install (macOS) |
| 80 | +
|
| 81 | + ```bash |
| 82 | + curl -fsSLO https://github.com/${{ github.repository }}/releases/download/latest/${FONT_NAME}-latest.zip |
| 83 | + unzip -o ${FONT_NAME}-latest.zip -d ~/Library/Fonts/ |
| 84 | + ``` |
| 85 | +
|
| 86 | + ### Install (Linux) |
| 87 | +
|
| 88 | + ```bash |
| 89 | + curl -fsSLO https://github.com/${{ github.repository }}/releases/download/latest/${FONT_NAME}-latest.zip |
| 90 | + mkdir -p ~/.local/share/fonts |
| 91 | + unzip -o ${FONT_NAME}-latest.zip -d ~/.local/share/fonts/ |
| 92 | + fc-cache -fv |
| 93 | + ``` |
| 94 | +
|
| 95 | + --- |
| 96 | +
|
| 97 | + > This is an automated pre-release from the latest commit on `main`. |
| 98 | + > For stable versions, see [tagged releases](https://github.com/${{ github.repository }}/releases). |
| 99 | + NOTES |
| 100 | + )" 2>/dev/null || \ |
| 101 | + gh release upload latest \ |
| 102 | + "_output/${FONT_NAME}-latest.zip" \ |
| 103 | + -R "${{ github.repository }}" \ |
| 104 | + --clobber |
0 commit comments