Skip to content

Commit

Permalink
Fix github build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtlink committed Jul 26, 2024
1 parent 1b93705 commit 15f9e04
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,32 @@ on: # yamllint disable-line rule:truthy
jobs:
build:
uses: metaborg/actions/.github/workflows/gradle-build-matrix.yaml@main
with:
gradle-command: |
gradle build
# Publish snapshots
publish-snapshot:
uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main
with:
gradle-command: |
gradle :publish -Pgitonium.isSnapshot=true
gradle publish -Pgitonium.isSnapshot=true
gradle-version-command: |
gradle -q :convention-plugin:printVersion -Pgitonium.isSnapshot=true
if: "github.event_name == 'push' && github.ref == 'refs/heads/main'"
needs: [build]
secrets:
METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }}
# Publish releases
publish-release:
uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main
with:
gradle-command: |
gradle :publish
gradle publish
gradle-version-command: |
gradle -q :convention-plugin:printVersion
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release-')"
needs: [build]
secrets:
METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }}

3 changes: 2 additions & 1 deletion repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ developers:
files:
githubWorkflows:
publishRelease: true
publishSnapshot: true
publishSnapshot: true
printVersionTask: ":convention-plugin:printVersion"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
gradle-command: |
gradle ${meta.files.githubWorkflows.buildTask}
@if(meta.files.githubWorkflows.publishSnapshot)

# Publish snapshots
publish-snapshot:
uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main
with:
Expand All @@ -27,13 +27,11 @@ jobs:
if: "github.event_name == 'push' && github.ref == 'refs/heads/${meta.mainBranch}'"
needs: [build]
secrets:
@raw
METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }}
@endraw
METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }}
@endif
@if(meta.files.githubWorkflows.publishRelease)

# Publish releases
publish-release:
uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main
with:
Expand All @@ -44,8 +42,6 @@ jobs:
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/${meta.releaseTagPrefix}')"
needs: [build]
secrets:
@raw
METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }}
@endraw
METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }}
@endif

0 comments on commit 15f9e04

Please sign in to comment.