Upgrade base to core20 #56
Workflow file for this run
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 ] | |
tags: [ v* ] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build LaTeXML snap | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: snapcraft | |
uses: snapcore/action-build@v1 | |
with: | |
path: snap | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: latexml-snap | |
path: ${{ steps.snapcraft.outputs.snap }} | |
retention-days: 5 | |
test: | |
name: Test LaTeXML snap | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Snapcraft setup | |
run: | | |
sudo apt update | |
sudo apt install -y snapd | |
- uses: actions/download-artifact@v4 | |
with: | |
name: latexml-snap | |
path: ./snap | |
- name: Install snap | |
run: | | |
sudo snap install snap/latexml_fixed.snap --devmode | |
- name: Test snap | |
run: | | |
latexml --VERSION || echo "Expected exit code 1" | |
latexml --dest=test.xml test.tex | |
release-stable: | |
if: startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, 'pre') | |
name: Release edge snap | |
needs: test | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: latexml-snap | |
path: ./snap | |
- name: Push to snapcraft.io | |
env: | |
SNAPCRAFT_TOKEN: ${{ secrets.METANORMA_SNAPCRAFT_TOKEN }} | |
run: | | |
echo "${SNAPCRAFT_TOKEN}" > .snapcraft_token | |
snapcraft login --with .snapcraft_token | |
snapcraft push --release=stable snap/latexml_fixed.snap | |
release-edge: | |
if: github.ref == 'refs/heads/master' | |
name: Release edge snap | |
needs: test | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: latexml-snap | |
path: ./snap | |
- name: Push to snapcraft.io | |
env: | |
SNAPCRAFT_TOKEN: ${{ secrets.METANORMA_SNAPCRAFT_TOKEN }} | |
run: | | |
echo "${SNAPCRAFT_TOKEN}" > .snapcraft_token | |
snapcraft login --with .snapcraft_token | |
snapcraft push --release=edge snap/latexml_fixed.snap | |
release-candidate: | |
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, 'pre') | |
name: Release stable snap | |
needs: test | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: latexml-snap | |
path: ./snap | |
- name: Push to snapcraft.io | |
env: | |
SNAPCRAFT_TOKEN: ${{ secrets.METANORMA_SNAPCRAFT_TOKEN }} | |
run: | | |
echo "${SNAPCRAFT_TOKEN}" > .snapcraft_token | |
snapcraft login --with .snapcraft_token | |
snapcraft push --release=candidate snap/latexml_fixed.snap |