Skip to content

Updates and cleanup #55

Updates and cleanup

Updates and cleanup #55

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
pull_request:
branches: ["main"]
# 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:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Run Invert on Test Projects and Generate GitHub Pages
# run: cd examples && ./gradlew :invert && cd ..
run: ./scripts/github-pages.main.kts
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload the generated pages
# path: './examples/build/reports/invert'
path: './build/static'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
test-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
- name: Test on Ubuntu
run: ./gradlew assemble check --no-build-cache --no-daemon --stacktrace
all-checks:
if: always()
runs-on: ubuntu-latest
needs:
- test-ubuntu
steps:
- name: require that all other jobs have passed
uses: re-actors/alls-green@release/v1
with:
allowed-skips: publish
jobs: ${{ toJSON(needs) }}
publish-snapshot:
needs: [ all-checks ]
runs-on: ubuntu-latest
if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
- name: Publish Snapshot
run: ./gradlew :invert-models:publish :invert-gradle-plugin:publish --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}