Compare commits
17 Commits
671d9c4631
...
48871f0ba9
Author | SHA1 | Date |
---|---|---|
Martin Scheidt | 48871f0ba9 | |
Martin Scheidt | e7affa27d8 | |
Martin Scheidt | 626eab873c | |
Martin Scheidt | e50ac4f404 | |
Martin Scheidt | a69459d314 | |
Martin Scheidt | 00f147e5cb | |
Martin Scheidt | 0844b50457 | |
Martin Scheidt | 61f05467be | |
Martin Scheidt | e1a290a3fb | |
Martin Scheidt | 7467babb4a | |
Martin Scheidt | 00257bb697 | |
Martin Scheidt | 679115df69 | |
Martin Scheidt | ac5f06edd6 | |
Martin Scheidt | ef88e7b56f | |
Martin Scheidt | c0f76145ef | |
Martin Scheidt | 60083d2833 | |
Martin Scheidt | e92c8d9208 |
|
@ -12,10 +12,12 @@ on:
|
|||
- '.github/workflows/cffvalidation.yml'
|
||||
- '.github/workflows/CompatHelper.yml'
|
||||
- '.github/workflows/debug.yml'
|
||||
- '.github/workflows/documenter.yml'
|
||||
- '.github/workflows/JuliaRegister.yml'
|
||||
- '.github/workflows/release.yml'
|
||||
- '.github/workflows/TagBot.yml'
|
||||
- '.github/zenodo/*'
|
||||
- 'docs'
|
||||
pull_request:
|
||||
branches: [ main, development ]
|
||||
paths-ignore:
|
||||
|
@ -28,10 +30,12 @@ on:
|
|||
- '.github/workflows/cffvalidation.yml'
|
||||
- '.github/workflows/CompatHelper.yml'
|
||||
- '.github/workflows/debug.yml'
|
||||
- '.github/workflows/documenter.yml'
|
||||
- '.github/workflows/JuliaRegister.yml'
|
||||
- '.github/workflows/release.yml'
|
||||
- '.github/workflows/TagBot.yml'
|
||||
- '.github/zenodo/*'
|
||||
- 'docs'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
|
@ -59,7 +63,7 @@ jobs:
|
|||
- x64
|
||||
# - aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: julia-actions/setup-julia@v1
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
|
@ -67,22 +71,3 @@ jobs:
|
|||
- uses: julia-actions/cache@v1
|
||||
- uses: julia-actions/julia-buildpkg@v1
|
||||
- uses: julia-actions/julia-runtest@v1
|
||||
docs:
|
||||
name: Documentation
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: julia-actions/setup-julia@v1
|
||||
with:
|
||||
version: '1'
|
||||
- uses: julia-actions/julia-buildpkg@v1
|
||||
- uses: julia-actions/julia-docdeploy@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
|
||||
- run: |
|
||||
julia --project=docs -e '
|
||||
using Documenter: DocMeta, doctest
|
||||
using TrainRuns
|
||||
DocMeta.setdocmeta!(TrainRuns, :DocTestSetup, :(using TrainRuns); recursive=true)
|
||||
doctest(TrainRuns)'
|
||||
|
|
|
@ -12,12 +12,10 @@ on:
|
|||
|
||||
## A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
debug:
|
||||
# needs: create_package
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
debug:
|
||||
name: "debug"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "checkout"
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
|
@ -30,3 +28,41 @@ jobs:
|
|||
uses: lhotari/action-upterm@v1
|
||||
with:
|
||||
limit-access-to-actor: true
|
||||
|
||||
# debug1:
|
||||
# name: "debug 1"
|
||||
# outputs:
|
||||
# output_variable: ${{ steps.set_variable.outputs.output_variable }}
|
||||
# runs-on: ubuntu-latest
|
||||
# # Steps represent a sequence of tasks that will be executed as part of the job
|
||||
# steps:
|
||||
# - name: "use the variable from previous step 'create variable'"
|
||||
# id: use_variable
|
||||
# run: |
|
||||
# echo "1. Current values:" >> $GITHUB_STEP_SUMMARY
|
||||
# echo "output variable: '${{ env.output_variable }}'" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# - name: "overwrite variable"
|
||||
# id: set_variable
|
||||
# run: |
|
||||
# echo "2. set varibales!" >> $GITHUB_STEP_SUMMARY
|
||||
# echo "output_variable=output" >> $GITHUB_OUTPUT # set variable
|
||||
|
||||
# - name: "use the variable from previous step 'create variable'"
|
||||
# id: use_variable_step
|
||||
# run: |
|
||||
# echo "3. use the variable from previous step" >> $GITHUB_STEP_SUMMARY
|
||||
# echo "output variable (via environment): '${{ env.output_variable }}'" >> $GITHUB_STEP_SUMMARY
|
||||
# echo "output variable (via output): '${{ steps.set_variable.outputs.output_variable }}'" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# debug2:
|
||||
# name: "debug 2"
|
||||
# needs: debug1
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: "use the variable from previous job 'debug 1'"
|
||||
# id: use_variable_job
|
||||
# run: |
|
||||
# echo "4. use the variable from previous job" >> $GITHUB_STEP_SUMMARY
|
||||
# echo "output variable (via environment): '${{ env.output_variable }}'" >> $GITHUB_STEP_SUMMARY
|
||||
# echo "output variable (via output): '${{ needs.debug1.outputs.output_variable }}'" >> $GITHUB_STEP_SUMMARY
|
||||
|
|
|
@ -4,57 +4,62 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version to register (without leading 'v' and semantic versioning schema, e.g. '1.0.1')"
|
||||
description: "Version to register (semantic versioning schema, e.g. '1.0.1'):"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
create_package:
|
||||
name: "create package"
|
||||
version:
|
||||
name: "check submitted version"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
previous_version: ${{ steps.version_test.outputs.previous_version }}
|
||||
current: ${{ steps.version_check.outputs.current }}
|
||||
new: ${{ steps.version_check.outputs.new }}
|
||||
steps:
|
||||
# 1. checkout the repo
|
||||
- name: "checkout"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 2. test if provided version number fits in semantic versioning schema
|
||||
- name: "test version number"
|
||||
id: version_test
|
||||
- name: "check version number"
|
||||
id: version_check
|
||||
run: |
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
echo "check if version follows the semantic version pattern"
|
||||
echo "Version to register '$VERSION':" >> $GITHUB_STEP_SUMMARY
|
||||
## =================================
|
||||
## check if version follows the semantic version pattern
|
||||
## ---------------------------------
|
||||
#remove a trailing 'v' if it exists
|
||||
if [[ ${VERSION:0:1} -eq "v" ]]; then
|
||||
VERSION=${VERSION:1}
|
||||
fi
|
||||
# check with regular expressions
|
||||
SEM_VER_REGEX="^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$"
|
||||
STATUS=0
|
||||
if [[ ! $VERSION =~ $SEM_VER_REGEX ]]; then
|
||||
STATUS=1
|
||||
fi
|
||||
if [ $STATUS = 1 ]; then
|
||||
echo "Version $VERSION does not follow the semantic versioning schema."
|
||||
echo "Please see https://semver.org/ for further information."
|
||||
echo "- :no_entry_sign: format does not follow the semantic versioning schema" >> $GITHUB_STEP_SUMMARY
|
||||
echo ":warning: Please see https://semver.org/ for further information." >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo "- follows the semantic versioning schema format :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
echo "check if version was already used"
|
||||
grep -qs "Version \[$VERSION\]" CHANGELOG.md && STATUS=1
|
||||
if [ $STATUS = 1 ]; then
|
||||
echo "Version $VERSION is already present in CHANGELOG.md."
|
||||
exit 1
|
||||
fi
|
||||
echo "check if version is an increment"
|
||||
## =================================
|
||||
## check if version is an increment
|
||||
## ---------------------------------
|
||||
VERSION_MAJOR=$(echo $VERSION | cut -d. -f1 )
|
||||
VERSION_MINOR=$(echo $VERSION | cut -d. -f2 )
|
||||
VERSION_PATCH=$(echo $VERSION | cut -d. -f3 )
|
||||
PREVIOUS_VERSION=$(grep -n -m 1 "## Version \[*.*.*\]" CHANGELOG.md | cut -d[ -f2 | cut -d] -f1)
|
||||
PREVIOUS_VERSION_MAJOR=$(echo $PREVIOUS_VERSION | cut -d. -f1 )
|
||||
PREVIOUS_VERSION_MINOR=$(echo $PREVIOUS_VERSION | cut -d. -f2 )
|
||||
PREVIOUS_VERSION_PATCH=$(echo $PREVIOUS_VERSION | cut -d. -f3 )
|
||||
if [[ $VERSION_MAJOR -eq PREVIOUS_VERSION_MAJOR ]]; then
|
||||
if [[ $VERSION_MINOR -eq PREVIOUS_VERSION_MINOR ]]; then
|
||||
if [[ $(($VERSION_PATCH - 1)) -ne PREVIOUS_VERSION_PATCH ]]; then
|
||||
CURRENT_VERSION=$(grep -n -m 1 "## Version \[*.*.*\]" CHANGELOG.md | cut -d[ -f2 | cut -d] -f1)
|
||||
CURRENT_VERSION_MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1 )
|
||||
CURRENT_VERSION_MINOR=$(echo $CURRENT_VERSION | cut -d. -f2 )
|
||||
CURRENT_VERSION_PATCH=$(echo $CURRENT_VERSION | cut -d. -f3 )
|
||||
if [[ $VERSION_MAJOR -eq CURRENT_VERSION_MAJOR ]]; then
|
||||
if [[ $VERSION_MINOR -eq CURRENT_VERSION_MINOR ]]; then
|
||||
if [[ $(($VERSION_PATCH - 1)) -ne CURRENT_VERSION_PATCH ]]; then
|
||||
STATUS=1
|
||||
fi
|
||||
else
|
||||
if [[ $(($VERSION_MINOR - 1)) -eq PREVIOUS_VERSION_MINOR ]]; then
|
||||
if [[ $(($VERSION_MINOR - 1)) -eq CURRENT_VERSION_MINOR ]]; then
|
||||
if [[ $VERSION_PATCH -ne 0 ]]; then
|
||||
STATUS=1
|
||||
fi
|
||||
|
@ -63,7 +68,7 @@ jobs:
|
|||
fi
|
||||
fi
|
||||
else
|
||||
if [[ $(($VERSION_MAJOR - 1)) -eq PREVIOUS_VERSION_MAJOR ]]; then
|
||||
if [[ $(($VERSION_MAJOR - 1)) -eq CURRENT_VERSION_MAJOR ]]; then
|
||||
if [[ $VERSION_MINOR -ne 0 ]]; then
|
||||
STATUS=1
|
||||
fi
|
||||
|
@ -75,144 +80,191 @@ jobs:
|
|||
fi
|
||||
fi
|
||||
if [ $STATUS = 1 ]; then
|
||||
echo "Version $VERSION skipped steps from the previous version $PREVIOUS_VERSION and thus does not follow the semantic versioning schema."
|
||||
echo "Please see https://semver.org/ for further information."
|
||||
echo "- :no_entry_sign: Version skipped steps from the previous version $CURRENT_VERSION and thus does not follow the semantic versioning schema." >> $GITHUB_STEP_SUMMARY
|
||||
echo "- :warning: Please see https://semver.org/ for further information." >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo "- is an increment from the previous version :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
echo "::set-output name=previous_version::$(version_test deposition show prereserved $PREVIOUS_VERSION)"
|
||||
## =================================
|
||||
## provide variables for subsequent jobs
|
||||
## ---------------------------------
|
||||
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "new=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
# 3. create release note
|
||||
create_package:
|
||||
name: "create package"
|
||||
needs: [version]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Creating package and release note for '${{ needs.version.outputs.new }}':" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 1. checkout the repo
|
||||
- name: "checkout"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 2. create release note
|
||||
- name: "create release note"
|
||||
run: |
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
PREVIOUS_VERSION=${{ needs.create_package.outputs.previous_version }}
|
||||
NEW_VERSION=${{ needs.version.outputs.new }}
|
||||
CURRENT_VERSION=${{ needs.version.outputs.current }}
|
||||
STATUS=0
|
||||
echo "create release note"
|
||||
## =================================
|
||||
## create release note
|
||||
## ---------------------------------
|
||||
TOP=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
|
||||
TOP=$(( $TOP + 1 ))
|
||||
BOTTOM=$(grep -n -m 1 "## Version \[$PREVIOUS_VERSION\]" CHANGELOG.md | cut -d: -f1)
|
||||
BOTTOM=$(( $BOTTOM - 1 ))
|
||||
awk "NR>$TOP&&NR<$BOTTOM" CHANGELOG.md > release-note-v$VERSION.md
|
||||
sed -i -- "s/###/##/g" release-note-v$VERSION.md
|
||||
echo "check if release note is empty"
|
||||
WORD_COUNT=$(wc -w release-note-v$VERSION.md | awk '{print $1}')
|
||||
BOTTOM=$(grep -n -m 1 "## Version \[$CURRENT_VERSION\]" CHANGELOG.md | cut -d: -f1)
|
||||
awk "NR>$TOP&&NR<$BOTTOM" CHANGELOG.md > release-note-v$NEW_VERSION.md
|
||||
sed -i -- "s/###/##/g" release-note-v$NEW_VERSION.md
|
||||
## =================================
|
||||
## check if release note is empty
|
||||
## ---------------------------------
|
||||
WORD_COUNT=$(wc -w release-note-v$NEW_VERSION.md | awk '{print $1}')
|
||||
if [[ $WORD_COUNT -lt 4 ]]; then
|
||||
STATUS=1
|
||||
fi
|
||||
if [ $STATUS = 1 ]; then
|
||||
echo "Please provide a meaningful CHANGELOG.md for the new version $VERSION"
|
||||
echo "- :no_entry_sign: 'Unreleased' section in CHANGELOG.md is empty" >> $GITHUB_STEP_SUMMARY
|
||||
echo ":warning: Please provide a meaningful CHANGELOG.md for the new version $NEW_VERSION." >> $GITHUB_STEP_SUMMA
|
||||
exit 1
|
||||
else
|
||||
echo "- 'Unreleased' section in CHANGELOG.md has content :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
## =================================
|
||||
## remove empty lines from top and bottom
|
||||
## ---------------------------------
|
||||
sed -i -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' release-note-v$NEW_VERSION.md
|
||||
|
||||
# 4. Update zenodo metadata.json
|
||||
- name: "Update zenodo metadata.json"
|
||||
run: |
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
sed -i".backup" -e"s/\"version\": \"%%\[SCRIPT\]\"/\"version\": \"$VERSION\"/g" .github/zenodo/metadata.json
|
||||
|
||||
# 5. create release archive
|
||||
# 3. create release archive
|
||||
- name: "create release archive"
|
||||
uses: papeloto/action-zip@v1
|
||||
uses: papeloto/action-zip@v1.1
|
||||
with:
|
||||
files: docs src test README.md LICENSE Project.toml
|
||||
recursive: false
|
||||
dest: TrainRuns.jl-v${{ github.event.inputs.version }}.zip
|
||||
dest: TrainRuns.jl-v${{ needs.version.outputs.new }}.zip
|
||||
- run: echo "- creating ZIP-Archive for the new release :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 6. upload artifact to share it with other jobs
|
||||
# 4. upload artifact to share it with other jobs
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: |
|
||||
release-note-v${{ github.event.inputs.version }}.md
|
||||
TrainRuns.jl-v${{ github.event.inputs.version }}.zip
|
||||
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: .github/zenodo/metadata.json
|
||||
release-note-v${{ needs.version.outputs.new }}.md
|
||||
TrainRuns.jl-v${{ needs.version.outputs.new }}.zip
|
||||
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
|
||||
- run: echo "- providing ZIP-Archive and release notes for other jobs :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
publish_github:
|
||||
needs: create_package
|
||||
needs: [create_package, version]
|
||||
name: "publish on github"
|
||||
outputs:
|
||||
url: ${{ steps.create_release.outputs.url }}
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Publishing package on Github:" >> $GITHUB_STEP_SUMMARY
|
||||
# 1. download artifact in folder artifact/
|
||||
- uses: actions/download-artifact@v3
|
||||
- run: echo "- getting ZIP-Archive and release notes :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 2. creating a new release
|
||||
- name: "create release"
|
||||
- uses: softprops/action-gh-release@v1
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
body_path: artifact/release-note-v${{ github.event.inputs.version }}.md
|
||||
draft: false
|
||||
prerelease: false
|
||||
body_path: artifact/release-note-v${{ needs.version.outputs.new }}.md
|
||||
files: artifact/TrainRuns.jl-v${{ needs.version.outputs.new }}.zip
|
||||
name: Release v${{ needs.version.outputs.new }}
|
||||
- run: echo "- drafting new release :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 3. upload package to new release
|
||||
- name: "upload release asset"
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: artifact/TrainRuns.jl-v${{ github.event.inputs.version }}.zip
|
||||
asset_name: TrainRuns.jl-v${{ github.event.inputs.version }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
# 4. publish release on github
|
||||
# 3. publish release on github
|
||||
- name: "publish release"
|
||||
uses: StuYarrow/publish-release@v1
|
||||
uses: StuYarrow/publish-release@v1.1.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
id: ${{ steps.create_release.outputs.id }}
|
||||
- run: echo "- publish release at ${{ steps.create_release.outputs.html_url }} :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
publish_zenodo:
|
||||
needs: create_package
|
||||
zenodo:
|
||||
needs: [create_package, version]
|
||||
name: "publish on zenodo"
|
||||
outputs:
|
||||
doi: ${{ steps.zenodraft.outputs.doi }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 1. download artifact in folder artifact/ and move it one level up
|
||||
- run: echo "Archiving package on zenodo to get a DOI:" >> $GITHUB_STEP_SUMMARY
|
||||
# 1. download artifact in folder artifact/ and move it one level up and checkout the repo
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
- run: |
|
||||
mv ./artifact/TrainRuns.jl-v${{ github.event.inputs.version }}.zip ./
|
||||
mv ./artifact/TrainRuns.jl-v${{ needs.version.outputs.new }}.zip ./
|
||||
echo "- getting ZIP-Archive and release notes :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 2. install zenodraft
|
||||
- name: "install zenodraft"
|
||||
run: npm install -g zenodraft
|
||||
env:
|
||||
URL: "https://zenodo.org/"
|
||||
run: |
|
||||
STATUS=0
|
||||
npm install -g zenodraft
|
||||
echo "- installing zenodraft :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
if ! curl --output /dev/null --silent --head --fail "$URL"; then
|
||||
STATUS=1
|
||||
fi
|
||||
if [ $STATUS = 1 ]; then
|
||||
echo "- :no_entry_sign: $URL is not reachable" >> $GITHUB_STEP_SUMMARY
|
||||
echo ":warning: Please re-run action later!" >> $GITHUB_STEP_SUMMARY
|
||||
echo ":warning: Please remove github release manually!" >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
else
|
||||
echo "- $URL is reachable :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
# 3. upload new release to zenodo
|
||||
# 3. Update zenodo metadata.json
|
||||
- name: "Update zenodo metadata.json"
|
||||
run: |
|
||||
VERSION=${{ needs.version.outputs.new }}
|
||||
sed -i".backup" -e"s/\"version\": \"%%\[SCRIPT\]\"/\"version\": \"$VERSION\"/g" .github/zenodo/metadata.json
|
||||
echo "- updating zenodo metadata :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 4. upload new release to zenodo
|
||||
- name: "uploading to zenodo"
|
||||
id: zenodraft
|
||||
env:
|
||||
ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}
|
||||
COLLECTION: 6448563
|
||||
run: |
|
||||
ID=$(zenodraft deposition create version $COLLECTION)
|
||||
zenodraft file add $ID TrainRuns.jl-v*.zip
|
||||
zenodraft metadata update $ID artifact/metadata.json
|
||||
zenodraft deposition publish $ID
|
||||
echo "::set-output name=doi::$(zenodraft deposition show prereserved $ID)"
|
||||
DOI=$(zenodraft deposition create version $COLLECTION)
|
||||
zenodraft file add $DOI TrainRuns.jl-v*.zip
|
||||
zenodraft metadata update $DOI .github/zenodo/metadata.json
|
||||
zenodraft deposition publish $DOI
|
||||
## =================================
|
||||
## provide variables for subsequent jobs
|
||||
## ---------------------------------
|
||||
echo "doi=10.5281/zenodo.$DOI" >> $GITHUB_OUTPUT
|
||||
echo "- publish release at zenodo with DOI: 10.5281/zenodo.$DOI :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
update_repo:
|
||||
needs: publish_zenodo
|
||||
update_repository:
|
||||
needs: [zenodo, version]
|
||||
name: "updating CITATION.cff and CHANGELOG.md"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Updating CITATION.cff and CHANGELOG.md:" >> $GITHUB_STEP_SUMMARY
|
||||
# 1. checkout the repo
|
||||
- name: "checkout"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 2. update CITATION.cff
|
||||
# with:
|
||||
# ref: main
|
||||
|
||||
# 2. update CITATION.cff
|
||||
- name: "update CITATION.cff"
|
||||
run: |
|
||||
DATE=$(date "+%Y-%m-%d")
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
VERSION=${{ needs.version.outputs.new }}
|
||||
DOI=${{ needs.publish_zenodo.outputs.doi }}
|
||||
echo "find lines in CITATION.cff"
|
||||
VERSION_LINE=$(grep -n '^version:' CITATION.cff | cut -d: -f1)
|
||||
|
@ -224,30 +276,33 @@ jobs:
|
|||
sed -i -- "${VERSION_LINE}s|.*|version: $VERSION|" CITATION.cff
|
||||
sed -i -- "${DATE_LINE}s|.*|date-released: ${DATE}|" CITATION.cff
|
||||
sed -i -- "${DOI_LINE}s|.*| value: $DOI|" CITATION.cff
|
||||
|
||||
echo "- updated CITATION.cff :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 3. update CHANGELOG.md
|
||||
- name: "update CHANGELOG.md"
|
||||
run: |
|
||||
DATE=$(date "+%Y-%m-%d")
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
VERSION=${{ needs.version.outputs.new }}
|
||||
URL="https://github.com/railtoolkit/TrainRuns.jl/compare"
|
||||
PREVIOUS_VERSION=${{ needs.create_package.outputs.previous_version }}
|
||||
CURRENT_VERSION=${{ needs.version.outputs.current }}
|
||||
echo "increment CHANGELOG.md"
|
||||
sed -i -- "/## \[Unreleased\]/a\\\n\n## Version [$VERSION] $DATE" CHANGELOG.md
|
||||
sed -i -- "s|^\[Unreleased\]: .*$|\[Unreleased\]: $URL/v$VERSION...main\n\[$VERSION\]: $URL/v$PREVIOUS_VERSION...v$VERSION|" CHANGELOG.md
|
||||
|
||||
sed -i -- "s|^\[Unreleased\]: .*$|\[Unreleased\]: $URL/v$VERSION...main\n\[$VERSION\]: $URL/v$CURRENT_VERSION...v$VERSION|" CHANGELOG.md
|
||||
echo "- updated CHANGELOG.md :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# 4. push the change back to main
|
||||
- name: push
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
message: "DOI updated to ${{ github.event.inputs.version }} (via github action)"
|
||||
message: "updated to ${{ needs.version.outputs.new }} (via github action)"
|
||||
add: CITATION.cff CHANGELOG.md
|
||||
author_name: railtoolkit
|
||||
author_email: railtoolkit@ownx.net
|
||||
- run: echo "- updated repository with new CITATION.cff and CHANGELOG.md :white_check_mark:" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
register:
|
||||
needs: update_repo
|
||||
name: "publish in JuliaRegistries"
|
||||
register_julia:
|
||||
needs: [update_repository]
|
||||
name: "register in JuliaRegistries"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 1. register new release at JuliaRegistries
|
||||
|
@ -256,13 +311,13 @@ jobs:
|
|||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
publish_mastodon:
|
||||
needs: publish_zenodo
|
||||
name: "Send toot about it to railtoolkit@fosstodon.org"
|
||||
needs: [zenodo, version, publish_github]
|
||||
name: "Send toot about it to fosstodon.org"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: cbrgm/mastodon-github-action@v1
|
||||
with:
|
||||
message: "The new version ${{ github.event.inputs.version }} of TrainRuns.jl is available! DOI: https://doi.org/${{needs.publish_zenodo.outputs.doi}}"
|
||||
message: "The new version ${{ needs.version.outputs.new }} of TrainRuns.jl is available! DOI: https://doi.org/${{ needs.zenodo.outputs.doi }} Further information at ${{ needs.publish_github.outputs.url }}."
|
||||
visibility: "public" # default: public
|
||||
env:
|
||||
MASTODON_URL: "https://fosstodon.org/"
|
||||
|
|
|
@ -9,6 +9,9 @@ Categories: Added, Changed, Deprecated, Removed, Fixed, and Security.
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
|
||||
## Version [1.0.3] 2022-12-30
|
||||
|
||||
### Added
|
||||
* documentation strings for functions in formulary.jl, output.jl, and behavior.jl
|
||||
|
||||
|
@ -217,7 +220,8 @@ Modules and variables were renamed.
|
|||
Proof of concept and master thesis submission.
|
||||
|
||||
|
||||
[Unreleased]: https://github.com/railtoolkit/TrainRuns.jl/compare/v1.0.2...main
|
||||
[Unreleased]: https://github.com/railtoolkit/TrainRuns.jl/compare/v1.0.3...main
|
||||
[1.0.3]: https://github.com/railtoolkit/TrainRuns.jl/compare/v1.0.2...v1.0.3
|
||||
[1.0.2]: https://github.com/railtoolkit/TrainRuns.jl/compare/v1.0.1...v1.0.2
|
||||
[1.0.1]: https://github.com/railtoolkit/TrainRuns.jl/compare/v1.0.0...v1.0.1
|
||||
[1.0.0]: https://github.com/railtoolkit/TrainRuns.jl/compare/v0.8...v1.0.0
|
||||
|
|
|
@ -20,7 +20,7 @@ identifiers:
|
|||
value: 10.5281/zenodo.6448563
|
||||
description: 'Collection of archived snapshots of all versions of the library'
|
||||
- type: doi
|
||||
value: 10.5281/zenodo.7040109
|
||||
value: 10.5281/zenodo.7495531
|
||||
description: Current version
|
||||
url: 'https://www.railtoolkit.org/projects/TrainRuns.jl/'
|
||||
repository: 'https://github.com/railtoolkit/TrainRuns.jl'
|
||||
|
@ -36,5 +36,5 @@ keywords:
|
|||
- driving dynamics
|
||||
- julia language
|
||||
license: ISC
|
||||
version: 1.0.2
|
||||
date-released: 2022-09-01
|
||||
version: 1.0.3
|
||||
date-released: 2022-12-30
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
[deps]
|
||||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
|
||||
TrainRuns = "e4541106-d44c-4e00-b50b-ecdf479fcf92"
|
||||
|
||||
[compat]
|
||||
Documenter = "0.27"
|
||||
|
|
|
@ -6,11 +6,11 @@ DocMeta.setdocmeta!(TrainRuns, :DocTestSetup, :(using TrainRuns); recursive=true
|
|||
makedocs(;
|
||||
modules=[TrainRuns],
|
||||
authors="Max Kannenberg, Martin Scheidt, and contributors",
|
||||
repo="https://github.com/railtoolkit/TrainRuns.jl/blob/{commit}{path}#{line}",
|
||||
repo="https://www.railtoolkit.org/TrainRuns.jl//blob/{commit}{path}#{line}",
|
||||
sitename="TrainRuns.jl",
|
||||
format=Documenter.HTML(;
|
||||
prettyurls=get(ENV, "CI", "false") == "true",
|
||||
canonical="https://railtoolkit.github.io/TrainRuns.jl",
|
||||
canonical="https://www.railtoolkit.org/TrainRuns.jl",
|
||||
assets=String[],
|
||||
),
|
||||
pages=[
|
||||
|
|
|
@ -2,13 +2,28 @@
|
|||
CurrentModule = TrainRuns
|
||||
```
|
||||
|
||||
# TrainRuns
|
||||
# [TrainRuns.jl](https://github.com/railtoolkit/TrainRuns.jl) Documentation
|
||||
|
||||
Documentation for [TrainRuns](https://github.com/railtoolkit/TrainRuns.jl).
|
||||
|
||||
```@index
|
||||
```@contents
|
||||
```
|
||||
|
||||
## Public Functions
|
||||
|
||||
```@autodocs
|
||||
Modules = [TrainRuns]
|
||||
Private = false
|
||||
```
|
||||
|
||||
## Privat Functions
|
||||
|
||||
```@autodocs
|
||||
Modules = [TrainRuns]
|
||||
Public = false
|
||||
```
|
||||
|
||||
## Index
|
||||
|
||||
```@index
|
||||
Modules = [TrainRuns]
|
||||
Order = [:function, :type]
|
||||
```
|
Loading…
Reference in New Issue