Skip to content

Commit ec42211

Browse files
authored
Merge pull request scala#219 from Philippus/update-regex
Update release tag pattern
2 parents faab1c2 + c5f42c2 commit ec42211

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

Diff for: admin/README.md

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
## Tag Driven Releasing
22

3-
### Background Reading
4-
5-
- http://docs.travis-ci.com/user/environment-variables/
6-
- http://docs.travis-ci.com/user/encryption-keys/
7-
- http://docs.travis-ci.com/user/encrypting-files/
8-
93
### Initial setup for the repository
104

115
To configure tag driven releases from Travis CI.
126

137
1. Generate a key pair for this repository with `./admin/genKeyPair.sh`.
148
Edit `.travis.yml` and `admin/build.sh` as prompted.
159
1. Publish the public key to https://pgp.mit.edu
16-
1. Store other secrets as encrypted environment variables with `admin/encryptEnvVars.sh`.
10+
1. Store other secrets as encrypted environment variables with `./admin/encryptEnvVars.sh`.
1711
Edit `.travis.yml` as prompted.
1812
1. Edit `.travis.yml` to use `./admin/build.sh` as the build script,
1913
and edit that script to use the tasks required for this project.
20-
1. Edit `build.sbt`'s `scalaVersionsByJvm in ThisBuild` to select Scala and JVM version
21-
combinations that will be used for publishing.
14+
Ensure that `RELEASE_COMBO` is `true` for build matrix combinations
15+
that should be released to sonatype (when building a tag).
2216

2317
It is important to add comments in `.travis.yml` to identify the name
24-
of each environment variable encoded in a `:secure` section.
18+
of each environment variable encoded in a `secure` section.
2519

2620
After these steps, your `.travis.yml` should contain config of the form:
2721

@@ -37,7 +31,8 @@ env:
3731
# SONA_PASS
3832
- secure: "XXXXXX"
3933
40-
script: admin/build.sh
34+
script:
35+
- admin/build.sh
4136
4237
jdk:
4338
- oraclejdk8
@@ -62,10 +57,9 @@ without generating a new key.
6257
1. Create a GitHub "Release" with a corresponding tag (e.g., `v0.1.1`) via the GitHub
6358
web interface.
6459
1. The release will be published using the Scala and JVM version combinations specified
65-
in `scalaVersionsByJvm` in `build.sbt`.
66-
- If you need to release against a different Scala version, include the Scala version
67-
and the JVM version to use in the tag name, separated by `#`s (e.g., `v0.1.1#2.13.0-M1#8`).
68-
Note that the JVM version needs to be listed in `.travis.yml` for the build to run.
60+
in the travis build matrix where `[ "$RELEASE_COMBO" = "true" ]`.
61+
- If you need to release against a different Scala version, create a new commit that modifies
62+
`.travis.yml` and push a new tag, e.g., `v1.2.3#2.13.0-M5`. The suffix after `#` is ignored.
6963
1. Travis CI will schedule a build for this release. Review the build logs.
7064
1. Log into https://oss.sonatype.org/ and identify the staging repository.
7165
1. Sanity check its contents.

Diff for: admin/build.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ set -e
1313
# [ "$RELEASE_COMBO" = "true" ].
1414

1515
# In order to build a previously released version against a new (binary incompatible) Scala release,
16-
# a new commit that modifies (and prunes) the Scala versions in .travis.yml needs to be added on top
17-
# of the existing tag. Then a new tag can be created for that commit, e.g., `v1.2.3#2.13.0-M5`.
18-
# Everything after the `#` in the tag name is ignored.
16+
# add a new commit that modifies (and prunes) the Scala versions in .travis.yml on top of the existing tag.
17+
# Then add a new tag for that commit, e.g., `v1.1.2#2.13.0-M5`. or `v1.1.2#native`. Everything after the `#`
18+
# in the tag name is ignored. Push the tag (the commit doesn't need to be on any branch).
1919

2020
if [[ "$SCALANATIVE_VERSION" != "" ]]; then
2121
if [[ "$TRAVIS_JDK_VERSION" == "oraclejdk8" && "$TRAVIS_SCALA_VERSION" =~ 2\.11\..* ]]; then
@@ -34,7 +34,7 @@ else
3434
fi
3535

3636
verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
37-
tagPat="^v$verPat(#$verPat#[0-9]+)?$"
37+
tagPat="^v$verPat(#.*)?$"
3838

3939
if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
4040
tagVer=${TRAVIS_TAG}

0 commit comments

Comments
 (0)