Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare switch from master to main #1275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
@@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- master
- main
- gh-pages
pull_request:
branches:
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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:
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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")}""")
@@ -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"]