Skip to content

Commit

Permalink
Build: consolidate publish-snapshots job into release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alexklibisz committed Nov 5, 2023
1 parent 66b9ce4 commit 175dca0
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 77 deletions.
44 changes: 1 addition & 43 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,46 +171,4 @@ jobs:
sudo chown -R runneradmin:runneradmin docs
task docsCompile
sudo chown -R runner:docker docs
ls -la docs/*
publish-snapshots:
name: Publish Snapshots
runs-on:
- ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
timeout-minutes: 1
with:
fetch-depth: 0 # Needed for git-based changelog.
- name: Setup pypirc file
timeout-minutes: 1
env:
TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: envsubst < .github/workflows/pypirc.template > $HOME/.pypirc
- uses: actions/setup-java@v3
timeout-minutes: 1
with:
distribution: 'adopt'
java-version: 19
cache: 'sbt'
- uses: actions/setup-python@v4
timeout-minutes: 1
with:
python-version: '3.10.8'
cache: 'pip'
- uses: arduino/setup-task@v1
timeout-minutes: 1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Setuptools
timeout-minutes: 1
run: python3 -m pip install setuptools
- name: Publish to PyPi
timeout-minutes: 1
run: task pyPublishSnapshot VERSION=$(cat version)-dev${{ github.run_number }}
- name: Publish Plugin to Github
timeout-minutes: 5
run: task jvmPublishSnapshot VERSION=$(cat version)-PR${{ github.event.pull_request.number }}-SNAPSHOT
ls -la docs/*
94 changes: 60 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,67 @@ permissions:
id-token: write

jobs:
release-plugin:
runs-on:
- ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Needed for git-based changelog.
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 19
cache: 'sbt'
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Assemble
run: task jvmAssemble
- name: Publish Release
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: task jvmPublishRelease
- name: Publish Snapshot
if: ${{ github.ref != 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: task jvmPublishSnapshot VERSION=$(cat version)-SNAPSHOT-${{ github.run_number }}-${{ github.run_attempt }}
release-python-client:
needs: release-plugin
runs-on:
- ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Needed for git-based changelog.
- uses: actions/setup-python@v4
with:
python-version: '3.10.8'
cache: 'pip'
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup pypirc file
env:
TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: envsubst < .github/workflows/pypirc.template > $HOME/.pypirc
- name: Setup Setuptools
run: python3 -m pip install setuptools
- name: Publish to pypi.org
if: ${{ github.ref == 'refs/heads/main' }}
run: task pyPublishRelease
- name: Publish to test.pypi.org
if: ${{ github.ref != 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: task pyPublishSnapshot VERSION=$(cat version)-dev-${{ github.run_number }}-${{ github.run_attempt }}
release-docs:
needs: release-python-client
if: ${{ github.ref == 'refs/heads/main' }}
runs-on:
- ubuntu-22.04
Expand Down Expand Up @@ -45,37 +105,3 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

release:
runs-on:
- ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Needed for git-based changelog.
- uses: actions/setup-python@v4
with:
python-version: '3.10.8'
cache: 'pip'
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 19
cache: 'sbt'
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup pypirc file
env:
TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: envsubst < .github/workflows/pypirc.template > $HOME/.pypirc
- name: Setup Setuptools
run: python3 -m pip install setuptools
- name: Publish to PyPi
run: task pyPublishRelease
- name: Publish to Github
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: task jvmPublishRelease

0 comments on commit 175dca0

Please sign in to comment.