Skip to content

Commit

Permalink
improve workflows, make mike work again
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed Nov 6, 2023
1 parent e0ef512 commit 0d9473a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
- name: Run I-Tests with Maven
run: ./mvnw integration-test failsafe:verify -Pitest -B -T4

coverage:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Upload coverage information
uses: codecov/codecov-action@v3
with:
Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,27 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip

- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('./docs/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# - name: Get pip cache dir
# id: pip-cache
# run: echo "::set-output name=dir::$(pip cache dir)"
#
# - name: Cache dependencies
# uses: actions/cache@v3
# with:
# path: ${{ steps.pip-cache.outputs.dir }}
# key: ${{ runner.os }}-pip-${{ hashFiles('./docs/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-

- name: Install dependencies
run: python3 -m pip install -r ./docs/requirements.txt
Expand All @@ -48,7 +49,7 @@ jobs:
GH_USERNAME: ${{ github.actor }}

- name: Pre-fetch the gh-pages branch
run: git fetch
run: git fetch --depth=1

- name: Build docs with MkDocs
run: mkdocs build
Expand All @@ -61,13 +62,13 @@ jobs:
# This is for a tagged version
- name: Create a new version of documentation and push to GH pages.
if: startsWith(github.ref, 'refs/tags/')
run: mike deploy ${{ steps.get_tag_name.outputs.TAG_NAME }} stable --push --rebase --update-aliases
run: mike deploy ${{ steps.get_tag_name.outputs.TAG_NAME }} stable --push --update-aliases

- name: Make stable to default.
if: startsWith(github.ref, 'refs/tags/')
run: mike set-default stable --push --rebase
run: mike set-default stable --push

# This is for develop
- name: Deploy latest develop snapshot docs to GH pages.
if: github.ref == 'refs/heads/develop'
run: mike deploy snapshot --push --rebase --update-aliases
run: mike deploy snapshot --push --update-aliases
22 changes: 15 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

# Get GPG private key into GPG
- name: Import GPG Owner Trust
run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust

- name: Import GPG key
run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes

# Setup JDK and Maven
- name: Set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -44,12 +37,27 @@ jobs:
- name: Run I-Tests with Maven
run: ./mvnw integration-test failsafe:verify -Pitest -B -T4 -ntp

deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
# Get GPG private key into GPG
- name: Import GPG Owner Trust
run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust

- name: Import GPG key
run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes

- name: Deploy a new version to central
run: ./mvnw deploy -B -ntp -DskipTests -Prelease -Dgpg.keyname="${{secrets.GPG_KEYNAME}}" -Dgpg.passphrase="${{secrets.GPG_PASSPHRASE}}"
env:
OSS_CENTRAL_USERNAME: "${{ secrets.SONATYPE_USERNAME }}"
OSS_CENTRAL_PASSWORD: "${{ secrets.SONATYPE_PASSWORD }}"

coverage:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Upload coverage information to CodeCov
uses: codecov/codecov-action@v3
with:
Expand Down

0 comments on commit 0d9473a

Please sign in to comment.