Use a more natural job name in example workflow #290
This file contains 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 and release | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
jobs: | |
luacheck: | |
name: Check code style (Lua) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install additional packages | |
run: | | |
set -e | |
sudo apt -qy update | |
sudo apt -qy install --no-install-recommends lua-check | |
- name: Install TeX Live | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | | |
l3build | |
- name: Install file "l3obsolete.txt" | |
run: tlmgr install --reinstall --with-doc l3kernel | |
- name: Generate file "explcheck-obsolete.lua" | |
run: l3build tag | |
- name: Run luacheck | |
run: | | |
find explcheck -type f -follow -name '*.lua' -not -name 'build.lua' -not -name 'explcheck-toml.lua' -exec luacheck {} + | |
explcheck: | |
name: Check code style (expl3) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install TeX Live | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | | |
l3build | |
luatex | |
- name: Install file "l3obsolete.txt" | |
run: tlmgr install --reinstall --with-doc l3kernel | |
- name: Generate file "explcheck-obsolete.lua" | |
run: l3build tag | |
- name: Run explcheck | |
run: | | |
set -e | |
export LUAINPUTS=explcheck/src | |
find */support -type f '(' -name '*.tex' -o -name '*.sty' ')' -exec \ | |
texlua explcheck/src/explcheck.lua {} + | |
tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install TeX Live | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | | |
l3build | |
- name: Install file "l3obsolete.txt" | |
run: tlmgr install --reinstall --with-doc l3kernel | |
- name: Run tests | |
run: | | |
l3build check | |
docker-image: | |
name: Build the Docker image | |
needs: [luacheck, explcheck, tests] | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install TeX Live | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | | |
l3build | |
- name: Install file "l3obsolete.txt" | |
run: tlmgr install --reinstall --with-doc l3kernel | |
- name: Build the Docker image | |
run: | | |
set -e | |
l3build tag | |
docker build -f explcheck/Dockerfile -t ghcr.io/witiko/expltools/explcheck . | |
- name: Login to GitHub Packages | |
if: github.ref == 'refs/heads/main' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish the Docker image | |
if: github.ref == 'refs/heads/main' | |
run: docker push ghcr.io/witiko/expltools/explcheck | |
ctan: | |
name: Build the CTAN archive | |
needs: [luacheck, explcheck, tests] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install additional packages | |
run: | | |
set -e | |
sudo apt -qy update | |
sudo apt -qy install --no-install-recommends parallel | |
- name: Install TeX Live | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | | |
scheme-basic | |
l3build | |
package-file: | | |
**/DEPENDS.txt | |
- name: Install file "l3obsolete.txt" | |
run: tlmgr install --reinstall --with-doc l3kernel | |
- name: Build the CTAN archive | |
run: | | |
set -e | |
l3build tag | |
l3build ctan | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CTAN archive | |
path: | | |
build/distrib/ctan/expltools-ctan.zip | |
- name: Create a prerelease | |
if: github.ref == 'refs/heads/main' | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
title: The latest version | |
automatic_release_tag: latest | |
prerelease: true | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
build/doc/*.pdf | |
build/distrib/ctan/expltools-ctan.zip |