Skip to content

Merge pull request #323 from alejandrohdezma/update/all #189

Merge pull request #323 from alejandrohdezma/update/all

Merge pull request #323 from alejandrohdezma/update/all #189

Workflow file for this run

# This workflow performs two tasks:
#
# - Creates a release of the project by running `sbt ci-publish` (this task should be added to the project as a command
# alias containing the necessary steps to do a release). An example of the `ci-publish` alias can be found in
# https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
#
# - Runs `sbt ci-docs` on the project and pushes a commit with the changes (the `ci-docs` task should be added to the
# project as a command alias containing the necessary steps to update documentation: re-generate docs files,
# publish websites, update headers...). An example of the `ci-docs` alias can be found in
# https://github.com/alejandrohdezma/sbt-github/blob/main/build.sbt.
#
# This workflow will launch on pushed tags. Alternatively one can launch it manually using a "workflow dispatch" to
# create a snapshot release (this won't trigger the documentation update).
name: Release
on:
push:
tags: [v*]
workflow_dispatch:
jobs:
release:
name: Release a new version of the artifact
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- name: Check latest tag follows semantic versioning
if: github.event_name == 'push'
uses: alejandrohdezma/actions/check-semver-tag@v1
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
distribution: "liberica"
java-version: "11"
cache: "sbt"
- name: Run `sbt ci-publish`
run: sbt ci-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
documentation:
needs: [release]
name: Updates documentation after latest release
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
ref: main
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
distribution: "liberica"
java-version: "17"
cache: "sbt"
- name: Run `sbt ci-docs`
run: sbt ci-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
- name: Commit changes by `sbt ci-docs`
uses: alejandrohdezma/actions/commit-and-push@v1
with:
message: Run `sbt ci-docs` [skip ci]
branch: main