Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding colophon page for license, DOI and citation #570

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4e90ebc
Fallback .nojekyll
cofinoa Oct 22, 2024
5705155
Merge branch 'cf-convention:main' into main
cofinoa Oct 22, 2024
7d50d23
Refactoring pages publishing
cofinoa Oct 23, 2024
de66368
Removing placeholder for templating
cofinoa Oct 23, 2024
7942fe6
Remove permissions
cofinoa Oct 23, 2024
5306a70
Remove environment
cofinoa Oct 23, 2024
9f355b0
Create gh-pages branch if not already exist
cofinoa Oct 23, 2024
0789f16
We need firs to clone repo
cofinoa Oct 23, 2024
4684646
write content permissions to GITHUB_TOKEN
cofinoa Oct 23, 2024
316ea8b
Add sudo to remove old images dir
cofinoa Oct 23, 2024
0f910f1
Add build dir to .gitignore
cofinoa Oct 24, 2024
e34f032
Merge branch 'cf-convention:main' into main
cofinoa Nov 8, 2024
b30c326
Initial commit for adding colophon
cofinoa Nov 14, 2024
b973314
Add CITATION.cff file.
cofinoa Nov 14, 2024
b724218
Complete citation info with version 1.11 info
cofinoa Nov 14, 2024
0e41b4b
Include the colophon section
cofinoa Nov 14, 2024
2ec941e
Adding push event to temporary branch
cofinoa Nov 14, 2024
ff45221
Update zenodo metada
cofinoa Nov 14, 2024
dcbcc9d
Adding working directories to gh-pages
cofinoa Nov 18, 2024
34f5f44
Fix sed expressions
cofinoa Nov 18, 2024
992746a
Escaping path sep in sed expressions
cofinoa Nov 18, 2024
143fa19
FIx sed expressions
cofinoa Nov 18, 2024
81e5d77
Adding sudo
cofinoa Nov 18, 2024
0c0e97c
Fixing typo on else
cofinoa Nov 18, 2024
0436c55
Improve push events
cofinoa Nov 18, 2024
1bab38c
Merge branch 'main' into add-colophon-doi-citation
cofinoa Nov 18, 2024
6c8fe9b
Ignore README
cofinoa Nov 18, 2024
a372e8e
Merge branch 'main' into add-colophon-doi-citation
cofinoa Nov 18, 2024
bb38303
Refactor GitHub Actions Workflow: Centralize configuration with envir…
cofinoa Nov 25, 2024
13cd42a
Fix typos
cofinoa Nov 25, 2024
5a1042a
Update adoc_build.yml
cofinoa Nov 25, 2024
8052590
Update adoc_build.yml
cofinoa Nov 25, 2024
5cdbbfe
Update adoc_build.yml
cofinoa Nov 25, 2024
d056a75
Publish assest to release
cofinoa Nov 26, 2024
b8045f0
Comment condensed
cofinoa Nov 26, 2024
2376fe0
Merge branch 'main' into add-colophon-doi-citation
cofinoa Nov 26, 2024
ce71e51
Renaming GH action file workflow
cofinoa Nov 26, 2024
4a8b076
Merge branch 'main' into add-colophon-doi-citation
cofinoa Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 54 additions & 20 deletions .github/workflows/adoc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,37 @@
# https://github.com/Analog-inc/asciidoctor-action
# https://github.com/actions/upload-artifact
# https://github.com/actions/download-artifact
# https://github.com/action-badges/create-orphan-branch
#
# Custom workflow for pages deployment
#
name: Asciidoctor Build Workflow
on:
# manually run workflow
workflow_dispatch:
# trigger on PR event against main (will not run publish job)
# trigger on PR event against main branch
pull_request:
branches: [ main ]
# Trigger on a push to main (a PR is merged), or when a release is
# published on github. These will run the publish job.
# Trigger on a push on branch except gh-pages branch
push:
branches:
- main
branches-ignore: [ gh-pages ]
# Trigger when a GitHub release is published.
release:
types:
- published
jobs:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Job to build cf-conventions.html, cf-conventions.pdf
build_conventions_and_conformance:
name: Build cf-conventions and conformance html and pdf
Expand All @@ -56,7 +69,11 @@ jobs:
- name: Copy index.html
run: |
sudo cp -p .github/gh-pages/index.html build/

# Update H1 header
- name: Update H1 header
run: |
PATH_REVISION="${GITHUB_REPOSITORY}/${GITHUB_REF_TYPE}/${GITHUB_REF_NAME}@${GITHUB_SHA:0:7}"
sudo sed -i s/Latest/"${PATH_REVISION//\//\\/}"/ build/index.html;
# Upload artifact containing cf-conventions.html, cf-conventions.pdf
- name: Save cf-conventions and conformance docs
uses: actions/upload-artifact@v4
Expand All @@ -75,21 +92,43 @@ jobs:
if: github.event_name != 'pull_request'
# Wait for the build artifacts to become available
needs: [build_conventions_and_conformance]

# # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
# permissions:
# pages: write # to deploy to Pages
# id-token: write # to verify the deployment originates from an appropriate source

# # Deploy to the github-pages environment
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
# Checkout repo
- uses: actions/checkout@v4
# create a new orphan branch if a branch with the given name does not already exist
- name: Create Orphan Branch
uses: action-badges/[email protected]
with:
branch-name: 'gh-pages'
# Checkout gh-pages branch
- uses: actions/checkout@v4
with:
ref: 'gh-pages'
- name: Add .nojekyll file if it doesn't exist
run: |
if [ ! -f .nojekyll ]; then
touch .nojekyll
fi
# Will new docs go into root, or into a directory named after the
# release?
- name: Determine where the new documents should live
run: |
if [[ ${{ github.event_name }} == 'release' ]]; then
# ${GITHUB_REF##*/} -> turns refs/tags/vM.m.p into vM.m.p
echo "TARGET_DIR=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "TARGET_DIR=releases/${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
else
echo "TARGET_DIR=." >> "$GITHUB_ENV"
echo "TARGET_DIR=${GITHUB_REF_TYPE}/${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
fi
# Obtain the build artifacts from the previous jobs and place them in the
# build/ directory
Expand All @@ -99,13 +138,11 @@ jobs:
path: build/
# If we are doing a release, we need to create the release directory
- name: Make release directory
if: github.event_name == 'release'
run: mkdir -p ${{ env.TARGET_DIR }}
# If we are not doing a release, let's clean out the previous images
# directory in the root directory
# directory in the root directory (OLD TO BE DEPRECATED)
- name: Remove old images directory
if: github.event_name != 'release'
run: rm -rf ${{ env.TARGET_DIR }}/images
run: sudo rm -rf ${{ env.TARGET_DIR }}/images
- name: Copy conventions and conformance documents
run: |
cp -p build/cf-conventions.html ${{ env.TARGET_DIR }}/
Expand All @@ -117,12 +154,9 @@ jobs:
# committed to the gh-pages branch
- name: Remove artifact directory
run: rm -rf build/
# If we are doing a release, update the index.html file to reflect the new
# latest release version.
- name: Update release index.html to point to new release
if: github.event_name == 'release'
run: |
sed -i s/Latest/"${GITHUB_REF##*/}"/ ${{ env.TARGET_DIR }}/index.html;
# Update root index.html: tree directories, excluding empty ones
- name: Update root index.html
run: tree -T ${GITHUB_REPOSITORY} --dirsfirst --prune --noreport -I index.html -I README.md -H . -o index.html
# Stage all changed files to git
- name: Add all changes to git
run: git add --all
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ conventions_build/
conformance.html
conformance.pdf
conformance_build/
build/
.vscode/
Loading