Bump shlex from 1.1.0 to 1.3.0 #40
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 | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
CARGO_TERM_COLOR: always | |
IMAGE_NAME: mdbook-bibfile-referencing | |
jobs: | |
legacy_pandoc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download Pandoc 2.10 | |
run: wget -O pandoc.deb https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-1-amd64.deb | |
- name: Install Pandoc | |
run: sudo dpkg -i pandoc.deb | |
- name: Install mdBook | |
run: cargo install mdbook --debug --no-default-features | |
- name: Cargo Test | |
run: cargo test -- --nocapture | |
modern_pandoc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download Pandoc 2.14 | |
run: wget -O pandoc.deb https://github.com/jgm/pandoc/releases/download/2.14.0.3/pandoc-2.14.0.3-1-amd64.deb | |
- name: Install Pandoc | |
run: sudo dpkg -i pandoc.deb | |
- name: Install mdBook | |
run: cargo install mdbook --debug --no-default-features | |
- name: Cargo Test | |
run: cargo test -- --nocapture | |
check_style: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cargo Format Check | |
run: cargo fmt -- --check | |
- name: Cargo Clippy | |
run: cargo clippy --all-features --all-targets -- -D warnings | |
- name: Cargo Sort Check | |
run: cargo install cargo-sort --debug && cargo-sort --workspace --check | |
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio | |
package: | |
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) }} | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
needs: [legacy_pandoc, modern_pandoc, check_style] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: docker build . --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push image | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | |
# Change all uppercase to lowercase | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
# Strip git ref prefix from version | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
# Strip "v" prefix from tag name | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
# Use Docker `latest` tag convention | |
[ "$VERSION" == "master" ] && VERSION=latest | |
echo IMAGE_ID=$IMAGE_ID | |
echo VERSION=$VERSION | |
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | |
docker push $IMAGE_ID:$VERSION | |
- uses: snok/container-retention-policy@v1 | |
name: Clean untagged images | |
with: | |
image-names: ${{ env.IMAGE_NAME }} | |
cut-off: 12 hours ago UTC | |
untagged-only: true | |
account-type: personal | |
token: ${{ secrets.PACKAGE_PAT }} |