62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: teatimeguest/setup-texlive-action@v3
|
|
with:
|
|
packages: scheme-full
|
|
- name: check
|
|
run: l3build check
|
|
- name: document
|
|
run: l3build doc
|
|
- name: install
|
|
run: l3build install
|
|
release:
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
needs:
|
|
- build-and-test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: google-github-actions/release-please-action@v4
|
|
id: release
|
|
with:
|
|
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
|
- uses: actions/checkout@v4
|
|
if: ${{ steps.release.outputs.prs_created }}
|
|
- uses: teatimeguest/setup-texlive-action@v3
|
|
with:
|
|
packages: scheme-basic
|
|
- name: Get PR number
|
|
run: |
|
|
echo ${{ toJSON(steps.release.outputs.pr) }} >> pr_json
|
|
echo "pr_number=$(jq -r '.number' pr_json)" >> $GITHUB_ENV
|
|
if: ${{ steps.release.outputs.prs_created }}
|
|
- name: Checkout PR code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: refs/pull/${{ env.pr_number }}/merge
|
|
if: ${{ steps.release.outputs.prs_created }}
|
|
- name: tag
|
|
run: l3build tag 0.1.0
|
|
if: ${{ steps.release.outputs.prs_created }}
|
|
- name: Commit and push
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add .
|
|
git commit -m "chore: tag files"
|
|
git push
|
|
if: ${{ steps.release.outputs.prs_created }}
|