Update job names according actual uploads #112
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: [ master ] | |
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 | |
- run: | | |
sudo apt update | |
sudo apt install -y squashfs-tools | |
unsquashfs -d extract ${{ steps.snapcraft.outputs.snap }} | |
ls -R extract | |
- uses: actions/upload-artifact@v3 | |
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@v3 | |
with: | |
name: latexml-snap | |
path: ./snap | |
- name: Install snap | |
run: | | |
sudo snap install snap/*.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 stable snap | |
needs: test | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
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 upload --release=stable snap/*.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@v3 | |
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 upload --release=edge snap/*.snap | |
release-candidate: | |
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, 'pre') | |
name: Release candidate snap | |
needs: test | |
runs-on: ubuntu-latest | |
container: | |
image: snapcore/snapcraft:stable | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
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 upload --release=candidate snap/*.snap |