Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/branches-and-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- master
- main
- gh-pages
pull_request:
branches:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
push:
branches:
- master
- main
tags:
- 'spock-*'

jobs:
build-and-verify:
runs-on: ${{ matrix.os }}
if: github.repository == 'spockframework/spock' && github.ref == 'refs/heads/master'
if: github.repository == 'spockframework/spock' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
strategy:
fail-fast: false
matrix:
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ if (gradle.startParameter.taskNames == ["ghActionsBuild"]) {
if (gradle.startParameter.taskNames == ["ghActionsPublish"] || gradle.startParameter.taskNames == ["ghActionsDocs"] ) {
def originalStartParamteterTaskNames = gradle.startParameter.taskNames
gradle.startParameter.taskNames = []
boolean isMaster = System.getenv("GITHUB_REF") == "refs/heads/master"
boolean isMain = (System.getenv("GITHUB_REF") == "refs/heads/master" || System.getenv("GITHUB_REF") == "refs/heads/main")
boolean isTag = System.getenv("GITHUB_REF")?.startsWith('refs/tags/spock-')
if (!(System.getenv("GITHUB_EVENT_NAME") == "push"
&& (isMaster || isTag)
&& (isMain || isTag)
&& System.getenv("GITHUB_REPOSITORY") == 'spockframework/spock')) {
throw new IllegalArgumentException("""ghActionsPublish can only be run on push to branch master or tag in repo spockframework/spock
throw new IllegalArgumentException("""ghActionsPublish can only be run on push to branch main or tag in repo spockframework/spock
event: ${System.getenv("GITHUB_EVENT_NAME")}
ref: ${System.getenv("GITHUB_REF")}
repo: ${System.getenv("GITHUB_REPOSITORY")}""")
Expand All @@ -254,7 +254,7 @@ if (gradle.startParameter.taskNames == ["ghActionsPublish"] || gradle.startParam
throw new IllegalArgumentException("ghActionsPublish can only be run on Java ${javaVersions.min()} but was run on $javaVersion")
}
/*
We want to release only snapshots directly from master, final releases will be tagged and then published from that tag.
We want to release only snapshots directly from main, final releases will be tagged and then published from that tag.
*/
if (snapshotVersion || isTag) {
gradle.startParameter.taskNames += ["publish"]
Expand Down