mirror of
https://github.com/jlengrand/jreleaser.git
synced 2026-03-10 08:31:24 +00:00
[chore] Update how version is set
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -13,8 +13,8 @@ jobs:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CI: true
|
||||
if: startsWith(github.event.head_commit.message, 'Releasing version') != true
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
|
||||
2
.github/workflows/early-access.yml
vendored
2
.github/workflows/early-access.yml
vendored
@@ -7,7 +7,7 @@ on:
|
||||
jobs:
|
||||
earlyaccess:
|
||||
name: "Early Access"
|
||||
if: github.repository == 'jreleaser/jreleaser'
|
||||
if: github.repository == 'jreleaser/jreleaser' && startsWith(github.event.head_commit.message, 'Releasing version') != true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -34,10 +34,19 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradlew-
|
||||
|
||||
- name: Set release version
|
||||
run: |
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
echo $VERSION > VERSION
|
||||
git add VERSION
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "GitHub Action"
|
||||
git commit -a -m "Releasing version $VERSION"
|
||||
git push origin main
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
./gradlew -Pversion=${{ github.event.inputs.version }} \
|
||||
-Prelease=true build -S
|
||||
./gradlew -Prelease=true build -S
|
||||
|
||||
- name: Deploy
|
||||
env:
|
||||
@@ -47,8 +56,7 @@ jobs:
|
||||
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
|
||||
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
|
||||
run: |
|
||||
./gradlew -Pversion=${{ github.event.inputs.version }} \
|
||||
-Prelease=true -Pfull-release=true \
|
||||
./gradlew -Prelease=true -Pfull-release=true \
|
||||
-PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} \
|
||||
-PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} \
|
||||
build publishToSonatype publishPlugins -S
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,4 +11,3 @@ target/
|
||||
tmp/
|
||||
.DS_Store
|
||||
.tmp
|
||||
VERSION
|
||||
|
||||
@@ -62,18 +62,10 @@ tasks.withType(Tar){
|
||||
compression = Compression.GZIP
|
||||
}
|
||||
|
||||
task versionFile {
|
||||
doLast {
|
||||
project.layout.buildDirectory.file('VERSION').get().asFile.text = project.version
|
||||
}
|
||||
}
|
||||
|
||||
classes.dependsOn(versionFile)
|
||||
|
||||
distributions {
|
||||
main {
|
||||
contents {
|
||||
from('build') {
|
||||
from('../..') {
|
||||
include 'VERSION'
|
||||
}
|
||||
}
|
||||
|
||||
11
build.gradle
11
build.gradle
@@ -15,6 +15,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
project.rootProject.ext.theVersion = file('VERSION').text.trim()
|
||||
|
||||
allprojects { p ->
|
||||
p.version = p.rootProject.ext.theVersion
|
||||
}
|
||||
|
||||
config {
|
||||
info {
|
||||
description = 'jreleaser'
|
||||
@@ -85,6 +92,4 @@ subprojects {
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
}
|
||||
|
||||
new File('VERSION').text = project.version
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
#
|
||||
|
||||
group = org.jreleaser
|
||||
version = 0.3.0-SNAPSHOT
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
|
||||
Reference in New Issue
Block a user