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:
|
matrix:
|
||||||
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
if: startsWith(github.event.head_commit.message, 'Releasing version') != true
|
||||||
CI: true
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/early-access.yml
vendored
2
.github/workflows/early-access.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
earlyaccess:
|
earlyaccess:
|
||||||
name: "Early Access"
|
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
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -34,10 +34,19 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradlew-
|
${{ 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
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./gradlew -Pversion=${{ github.event.inputs.version }} \
|
./gradlew -Prelease=true build -S
|
||||||
-Prelease=true build -S
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
env:
|
env:
|
||||||
@@ -47,8 +56,7 @@ jobs:
|
|||||||
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
|
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
|
||||||
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
|
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
|
||||||
run: |
|
run: |
|
||||||
./gradlew -Pversion=${{ github.event.inputs.version }} \
|
./gradlew -Prelease=true -Pfull-release=true \
|
||||||
-Prelease=true -Pfull-release=true \
|
|
||||||
-PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} \
|
-PsonatypeUsername=${{ secrets.SONATYPE_USERNAME }} \
|
||||||
-PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} \
|
-PsonatypePassword=${{ secrets.SONATYPE_PASSWORD }} \
|
||||||
build publishToSonatype publishPlugins -S
|
build publishToSonatype publishPlugins -S
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,4 +11,3 @@ target/
|
|||||||
tmp/
|
tmp/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.tmp
|
.tmp
|
||||||
VERSION
|
|
||||||
|
|||||||
@@ -62,18 +62,10 @@ tasks.withType(Tar){
|
|||||||
compression = Compression.GZIP
|
compression = Compression.GZIP
|
||||||
}
|
}
|
||||||
|
|
||||||
task versionFile {
|
|
||||||
doLast {
|
|
||||||
project.layout.buildDirectory.file('VERSION').get().asFile.text = project.version
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
classes.dependsOn(versionFile)
|
|
||||||
|
|
||||||
distributions {
|
distributions {
|
||||||
main {
|
main {
|
||||||
contents {
|
contents {
|
||||||
from('build') {
|
from('../..') {
|
||||||
include 'VERSION'
|
include 'VERSION'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,13 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
project.rootProject.ext.theVersion = file('VERSION').text.trim()
|
||||||
|
|
||||||
|
allprojects { p ->
|
||||||
|
p.version = p.rootProject.ext.theVersion
|
||||||
|
}
|
||||||
|
|
||||||
config {
|
config {
|
||||||
info {
|
info {
|
||||||
description = 'jreleaser'
|
description = 'jreleaser'
|
||||||
@@ -86,5 +93,3 @@ subprojects {
|
|||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
new File('VERSION').text = project.version
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
group = org.jreleaser
|
group = org.jreleaser
|
||||||
version = 0.3.0-SNAPSHOT
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user