Skip to content

Commit

Permalink
Re-enable Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Jul 1, 2024
1 parent 0ac12c8 commit 603ed0e
Showing 1 changed file with 36 additions and 32 deletions.
68 changes: 36 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ jobs:
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3


- name: Test on Ubuntu
- name: Run Checks
run: ./gradlew assemble check --no-build-cache --no-daemon --stacktrace

# Deploy to Github Pages
Expand All @@ -47,8 +46,6 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs:
- test-ubuntu
if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
steps:
- name: Checkout
Expand All @@ -62,7 +59,6 @@ jobs:
check-latest: true

- 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
Expand All @@ -72,18 +68,34 @@ jobs:
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

publish-check:
runs-on: ubuntu-latest
if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
outputs:
is_snapshot: ${{ steps.check.outputs.is_snapshot }}
steps:
- name: Retrieve Version from gradle.properties
run: echo "VERSION_NAME=$(cat gradle.properties | grep "^version=" | awk -F'=' '{print $2}')" >> $GITHUB_ENV

- name: Set up environment variable
run: |
if [[ "${VERSION_NAME}" == *-SNAPSHOT ]]; then
echo "::set-output name=is_snapshot::true"
else
echo "::set-output name=is_snapshot::false"
fi
publish-snapshot:
needs:
- test-ubuntu
- publish-check
runs-on: ubuntu-latest
if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: needs.check-snapshot.outputs.is_snapshot == 'true'
timeout-minutes: 25

steps:
Expand All @@ -100,23 +112,18 @@ jobs:
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3

- name: Retrieve Version from gradle.properties
run: echo "VERSION_NAME=$(cat gradle.properties | grep "^version=" | awk -F'=' '{print $2}')" >> $GITHUB_ENV

- name: Publish Snapshot
run: ./gradlew :invert-models:publish :invert-gradle-plugin:publish --no-configuration-cache --stacktrace
if: success() && endsWith(env.VERSION_NAME, '-SNAPSHOT')
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

# - name: Publish Snapshot
# run: ./gradlew :invert-models:publish :invert-gradle-plugin:publish --no-configuration-cache --stacktrace
# if: success() && endsWith(env.VERSION_NAME, '-SNAPSHOT')
# env:
# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

publish-release:
# Temporary to help debug publishing of 0.0.1-dev
# needs:
# - test-ubuntu
needs:
- publish-check
runs-on: ubuntu-latest
if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: needs.check-snapshot.outputs.is_snapshot == 'false'
timeout-minutes: 25

steps:
Expand All @@ -133,13 +140,10 @@ jobs:
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3

- name: Retrieve Version from gradle.properties
run: echo "VERSION_NAME=$(cat gradle.properties | grep "^version=" | awk -F'=' '{print $2}')" >> $GITHUB_ENV

- name: Publish release (main only)
run: ./gradlew publishToMavenCentral --no-configuration-cache --stacktrace --no-parallel
if: success() && !endsWith(env.VERSION_NAME, '-SNAPSHOT')
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
# - name: Publish release (main only)
# run: ./gradlew publishToMavenCentral --no-configuration-cache --stacktrace --no-parallel
# if: success() && !endsWith(env.VERSION_NAME, '-SNAPSHOT')
# env:
# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
# ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}

0 comments on commit 603ed0e

Please sign in to comment.