restructured github actions

master
Martin Scheidt 2022-04-01 21:36:25 +02:00
parent ac3e664ae6
commit ae8ed95aee
9 changed files with 224 additions and 19 deletions

View File

@ -1,7 +1,6 @@
## -- engine used to compile (pdflatex)
latex-bin
latexmk
ctan-o-mat
## -- direct dependencies
tikz-trackschematic

2
.github/tex/packages.upload.txt vendored Normal file
View File

@ -0,0 +1,2 @@
## -- upload
ctan-o-mat

View File

@ -12,8 +12,42 @@ on:
## A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
create_package:
name: "create a TeX Live package"
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: "checkout"
uses: actions/checkout@v2
# create package and release notes
- name: "create tikz-trackschematic package"
run: ./build.sh --non-interactive --release v0.7.0
# upload artifact two share it with other jobs
- uses: actions/upload-artifact@v3
with:
path: tikz-trackschematic-v0.7.0.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: release-note-v0.7.0.md
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: .github/tex/tikz-trackschematic.pkg
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: .github/zenodo/metadata.json
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
# This workflow contains a single job called "build"
debug:
needs: create_package
# The type of runner that the job will run on
runs-on: ubuntu-latest
@ -23,8 +57,11 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v2
- name: "install ghostscript"
run: sudo apt-get install -y ghostscript
- uses: actions/download-artifact@v3
id: download
# - name: "install ghostscript"
# run: sudo apt-get install -y ghostscript
###### multiple options for a TeX environment
# ##
@ -45,11 +82,11 @@ jobs:
# with:
# package-file: .github/tex/packages.test.txt
# ##
- name: "setup TeX Live (via paolobrasolin)"
uses: paolobrasolin/setup-texlive-action@v1
with:
profile-path: ${{ github.workspace }}/.github/tex/profile.minimal.txt
packages-path: ${{ github.workspace }}/.github/tex/packages.doc.txt
# - name: "setup TeX Live (via paolobrasolin)"
# uses: paolobrasolin/setup-texlive-action@v1
# with:
# profile-path: ${{ github.workspace }}/.github/tex/profile.minimal.txt
# packages-path: ${{ github.workspace }}/.github/tex/packages.doc.txt
# - name: "install tikz-trackschematic"
# run: ./build.sh --non-interactive --install-dev

View File

@ -11,7 +11,8 @@ on:
## A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
create_package:
name: "create a TeX Live package for tikz-trackschematic"
runs-on: ubuntu-latest
steps:
# 1. checkout the repo
@ -32,8 +33,7 @@ jobs:
- name: "update tikz-trackschematic documentation before release"
run: ./build.sh --non-interactive --memory-increase --compile-doc
# 4. create package and release notes
## get varibale ${{ steps.tag.outputs.tag }}
# 4. get varibale ${{ steps.tag.outputs.tag }}
- name: "get tag"
id: tag
uses: dawidd6/action-get-tag@v1
@ -41,10 +41,48 @@ jobs:
# Optionally strip `v` prefix
strip_v: false
# 5. create package and release notes
- name: "create tikz-trackschematic package"
run: ./build.sh --non-interactive --release ${{ steps.tag.outputs.tag }}
# 5. publish package as new release on github
# 6. upload artifact to share it with other jobs
- uses: actions/upload-artifact@v3
with:
path: tikz-trackschematic-v0.7.0.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: release-note-v0.7.0.md
if-no-files-found: warn # 'error' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: .github/tex/tikz-trackschematic.pkg
if-no-files-found: warn # 'error' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: .github/zenodo/metadata.json
if-no-files-found: warn # 'error' or 'ignore' are also available, defaults to `warn`
publish_github:
needs: create_package
name: "publish on github"
runs-on: ubuntu-latest
steps:
# 1. get varibale ${{ steps.tag.outputs.tag }}
- name: "get tag"
id: tag
uses: dawidd6/action-get-tag@v1
with:
# Optionally strip `v` prefix
strip_v: false
# 2. download artifact in folder artifact/
- uses: actions/download-artifact@v3
# 3. publish package as new release on github
- name: "create release"
id: create_release
uses: actions/create-release@v1
@ -53,7 +91,7 @@ jobs:
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: release-note-${{ steps.tag.outputs.tag }}.md
body_path: artifact/release-note-${{ steps.tag.outputs.tag }}.md
draft: false
prerelease: false
@ -63,7 +101,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: tikz-trackschematic-${{ steps.tag.outputs.tag }}.zip
asset_path: artifact/tikz-trackschematic-${{ steps.tag.outputs.tag }}.zip
asset_name: tikz-trackschematic-${{ steps.tag.outputs.tag }}.zip
asset_content_type: application/zip
@ -74,6 +112,21 @@ jobs:
with:
id: ${{ steps.create_release.outputs.id }}
# 6. upload new release to CTAN
publish_CTAN:
needs: create_package
name: "publish on CTAN"
runs-on: ubuntu-latest
steps:
# 1. download artifact in folder artifact/
- uses: actions/download-artifact@v3
# 2. install ctan-o-mat
- name: "setup TeX Live (via paolobrasolin)"
uses: paolobrasolin/setup-texlive-action@v1
with:
profile-path: ${{ github.workspace }}/.github/tex/profile.minimal.txt
packages-path: ${{ github.workspace }}/.github/tex/packages.upload.txt
# 3. upload new release to CTAN
- name: CTAN submit
run: ctan-o-mat --verbose --submit .github/tex/tikz-trackschematic.pkg
run: ctan-o-mat --verbose --submit artifact/tikz-trackschematic.pkg

View File

@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions
name: test
name: "continuous integration test"
# Controls when the workflow will run
on:

72
.github/workflows/zenodo.yaml vendored Normal file
View File

@ -0,0 +1,72 @@
name: zenodo sandbox test
on:
# # Trigger when you publish a release via GitHub's release page
# release:
# types:
# - published
# # Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
create_package:
name: "create a TeX Live package"
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: "checkout"
uses: actions/checkout@v2
# create package and release notes
- name: "create tikz-trackschematic package"
run: ./build.sh --non-interactive --release v0.7.0
# upload artifact to share it with other jobs
- uses: actions/upload-artifact@v3
with:
path: tikz-trackschematic-v0.7.0.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: release-note-v0.7.0.md
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: .github/tex/tikz-trackschematic.pkg
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
- uses: actions/upload-artifact@v3
with:
path: .github/zenodo/metadata.json
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
publish_zenodo:
needs: create_package
name: "publish on zenodo sandbox"
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: "checkout"
uses: actions/checkout@v2
# download artifact in folder artifact/
- uses: actions/download-artifact@v3
- name: "uploading to zenodo sandbox"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}
ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}
uses: zenodraft/action@0.10.0
with:
# collection: 5539844
collection: 1047380
filenames: artifact/tikz-trackschematic-v0.7.0.zip
upsert-doi: true
upsert-location: identifiers[2]
metadata: artifact/metadata.json
publish: true
sandbox: true
verbose: true

30
.github/zenodo/metadata.json vendored Normal file
View File

@ -0,0 +1,30 @@
{
"title": "TikZ-trackschematic",
"version": "%%[SCRIPT]",
"publication_date": "%%[SCRIPT]",
"creators": [
{
"orcid": "0000-0002-9384-8945",
"affiliation": "TU Braunschweig",
"name": "Scheidt, Martin"
}
],
"description": "A TikZ library for creating track diagrams in railways. The TikZ-trackschematic library is a toolbox of symbols geared primarily towards creating track schematic for either research or educational purposes. It provides a TikZ frontend to some of the symbols which maybe needed to describe situations and layouts in railway operation.",
"keywords": [
"tex",
"tikz",
"railway",
"railroad",
"tracks",
"schematics"
],
"license": {
"id": "ISC"
},
"language": "eng",
"access_right": "open",
"resource_type": {
"type": "software",
"title": "Software"
}
}

View File

@ -1,6 +1,6 @@
# TikZ-trackschematic
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5539844.svg)](https://doi.org/10.5281/zenodo.5539844)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5539844.svg)](https://doi.org/10.5281/zenodo.5539844) [![continuous integration test](https://github.com/railtoolkit/tikz-trackschematic/actions/workflows/testing.yml/badge.svg)](https://github.com/railtoolkit/tikz-trackschematic/actions/workflows/testing.yml)
------------

View File

@ -591,6 +591,15 @@ create_ctan_configuration() {
mv .github/tex/tikz-trackschematic.tmp.pkg .github/tex/tikz-trackschematic.pkg
}
create_zenodo_metadata() {
# modify the file .github/zenodo/metadata.json for zenodo upload
# 1. replace "version": "%%[SCRIPT]"
sed -i".backup" -e"s/\"version\": \"%%\[SCRIPT\]\"/\"version\": \"$VERSION_STR\"/g" .github/zenodo/metadata.json
# 2. replace "publication_date": "%%[SCRIPT]"
sedi "s/\"publication_date\": \"%%\[SCRIPT\]\"/\"publication_date\": \"$DATE\"/g" .github/zenodo/metadata.json
}
run_compile_documentation() {
## compile order
# 1. manual, symbology-table, snippets
@ -959,6 +968,8 @@ cleanup() {
rm release-note.tmp.md
# # undo changes to .github/tex/tikz-trackschematic.pkg by sed
# mv .github/tex/tikz-trackschematic.pkg.backup .github/tex/tikz-trackschematic.pkg
# # undo changes to .github/zenodo/metadata.json by sed
# mv .github/zenodo/metadata.json.backup .github/zenodo/metadata.json
fi
##
@ -1052,6 +1063,7 @@ if [ $RELEASE = 1 ]; then
create_release
create_release_notes
create_ctan_configuration
create_zenodo_metadata
fi
##