diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..3d36804 --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,108 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + release: + types: [published] + workflow_dispatch: + + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + 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: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - if: github.event.release != null + name: set release vars from release event + run: | + echo "LONG_DATE=${{ github.event.release.published_at }}" >> $GITHUB_ENV + echo "LONG_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV + - if: github.event.release == null + name: Get previous release + id: previousrelease + uses: InsonusK/get-latest-release@v1.0.1 + with: + myToken: ${{ github.token }} + exclude_types: draft|prerelease + view_top: 1 + - if: github.event.release == null + name: set release vars from previous release + run: | + echo "LONG_DATE=${{ steps.previousrelease.outputs.created_at }}" >> $GITHUB_ENV + echo "LONG_VERSION=${{ steps.previousrelease.outputs.tag_name }}" >> $GITHUB_ENV + - name: Cut release date + uses: bhowell2/github-substring-action@1.0.2 + id: cut_release_date + with: + value: ${{ env.LONG_DATE }} + length_from_start: 10 + - name: Cut release versopm + uses: bhowell2/github-substring-action@1.0.2 + id: cut_release_version + with: + value: ${{ env.LONG_VERSION }} + index_of_str: "v" + - name: Substitute env vars in files + uses: chris-peterson/virgo@v1 + env: + RELEASE_DATE: ${{ steps.cut_release_date.outputs.substring }} + RELEASE_VERSION: ${{ steps.cut_release_version.outputs.substring }} + with: + templates: "specification/metadata.md" + - name: Build the spec-publisher project & produce site artifacts + run: | + cd spec-publisher + mvn clean package + java -jar target/mets-profile-proc.jar ../profile/E-ARK-DIP.xml + - name: Run Docker job for site publication + run: | + docker run --rm -v "$PWD:/source" --entrypoint /source/create-site.sh eark4all/spec-pdf-publisher + ls -alh ./docs + - name: Build the spec-publisher project & produce PDF artifacts + run: | + git clone --branch feat/pdf-publication https://github.com/DILCISBoard/spec-publisher.git pdf-publisher + cd pdf-publisher + mvn clean package + java -jar target/mets-profile-proc.jar ../profile/E-ARK-DIP.xml + - name: Run Docker job for PDF publication + run: | + docker run --rm -v "$PWD:/source" --entrypoint /source/create-pdf.sh eark4all/spec-pdf-publisher + ls -alh ./docs + ls -alh ./docs/pdf + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Build with Jekyll docker box + run: | + mkdir _site + docker run --rm -v "$PWD"/docs:/usr/src/app -v "$PWD"/_site:/_site starefossen/github-pages jekyll build -d /_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1891732..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -dist: trusty -sudo: required -language: java -jdk: -- openjdk8 -script: -- cd spec-publisher -- mvn clean package -- java -jar target/mets-profile-proc.jar ../profile/E-ARK-DIP.xml -- cd .. -- docker run -it --rm -v "$PWD:/source" -u "$(id -u):$(id -g)" --entrypoint /source/create-site.sh eark4all/spec-pdf-publisher -- cd spec-publisher -- git checkout feat/pdf-publication -- mvn clean package -- java -jar target/mets-profile-proc.jar ../profile/E-ARK-DIP.xml -- cd .. -- docker run -it --rm -v "$PWD:/source" -u "$(id -u):$(id -g)" --entrypoint /source/create-pdf.sh eark4all/spec-pdf-publisher -- mkdir site -- docker run -it --rm -v "$PWD"/docs:/usr/src/app -v "$PWD"/site:/_site -u "$(id -u):$(id -g)" starefossen/github-pages jekyll build -d /_site -- bundle install -- bundle exec htmlproofer ./site --file-ignore /javadoc/ --only-4xx --check-html -deploy: - provider: pages - skip_cleanup: true - github_token: "$GH_TOKEN" - keep_history: true - local_dir: site - fqdn: "$CNAME" - on: - branch: master -env: - global: - - NOKOGIRI_USE_SYSTEM_LIBRARIES=true diff --git a/spec-publisher b/spec-publisher index 8ee9ea8..c032a3b 160000 --- a/spec-publisher +++ b/spec-publisher @@ -1 +1 @@ -Subproject commit 8ee9ea80c3d50d428831df712a82d69896dd60fc +Subproject commit c032a3b725fe9bdaa5a4f75bd437891614206a83 diff --git a/specification/metadata.md b/specification/metadata.md index cfb51a8..5084f44 100644 --- a/specification/metadata.md +++ b/specification/metadata.md @@ -9,6 +9,6 @@ abstract: | a text document explaining the details of use of this profile. This will enable repository interoperability and assist in the management of the preservation of digital content. -version: 2.1.0 -date: 15.10.2021 +version: ${RELEASE_VERSION} +date: ${RELEASE_DATE} ---