diff --git a/.github/workflows/early-access.yaml b/.github/workflows/early-access.yaml index 20eeed60..1de5566f 100644 --- a/.github/workflows/early-access.yaml +++ b/.github/workflows/early-access.yaml @@ -30,7 +30,7 @@ env: jobs: build: name: 'Build with Graal on ${{ matrix.os }}' - if: startsWith(github.event.head_commit.message, 'Updated CHANGELOG.md') != true && startsWith(github.event.head_commit.message, '[maven-release-plugin]') != true + if: startsWith(github.event.head_commit.message, '[release] Release ') != true strategy: fail-fast: false matrix: @@ -70,47 +70,5 @@ jobs: - name: 'Upload artifact' uses: actions/upload-artifact@v2 with: - name: artifacts + name: mvnd-${{ env.OS }} path: dist/target/mvnd-*.zip - - early-access: - runs-on: ubuntu-18.04 - needs: [build] - # Only post early access releases when push to master - if: false && ${{ !github.event.issue.pull_request }} && startsWith(github.ref, 'refs/heads/master') - - steps: - - name: 'Check out repository' - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: 'Download all build artifacts' - uses: actions/download-artifact@v2 - - - name: 'Set up Java' - uses: actions/setup-java@v2 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: 'zulu' - - - name: 'Cache Maven packages' - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: 'Release to GitHub' - env: - JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./mvnw -B --file pom.xml -pl :mvnd -DartifactsDir=artifacts jreleaser:release - - - name: 'JReleaser output' - if: always() - uses: actions/upload-artifact@v2 - with: - name: jreleaser-logs - path: | - target/jreleaser/trace.log - target/jreleaser/output.properties diff --git a/.github/workflows/release-candidate-stage1.yml b/.github/workflows/release-candidate-stage1.yml deleted file mode 100644 index e7fec3ff..00000000 --- a/.github/workflows/release-candidate-stage1.yml +++ /dev/null @@ -1,95 +0,0 @@ -# -# Copyright (c) 2017 Angelo Zerr and other contributors as -# indicated by the @author tags. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: Release Candidate - Stage1 - -# manual trigger -on: - workflow_dispatch: - -env: - GRAALVM_VERSION: '21.3.0' - JAVA_VERSION: '17' - -jobs: - build: - name: 'Build with Graal on ${{ matrix.os }}' - strategy: - fail-fast: true - matrix: - os: [ ubuntu-18.04, macOS-10.15, windows-2019 ] - runs-on: ${{ matrix.os }} - - steps: - - name: 'Checkout' - uses: actions/checkout@v2 - - - name: 'Set vars' - shell: bash - run: | - OS=$(echo '${{ runner.os }}' | awk '{print tolower($0)}') - [[ $OS == 'ubuntu' ]] && echo "OS=linux" >> $GITHUB_ENV || echo "OS=$OS" >> $GITHUB_ENV - [[ $OS == 'macos' ]] && echo "OS=darwin" >> $GITHUB_ENV || echo "OS=$OS" >> $GITHUB_ENV - echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV - - - name: 'Set up Graal' - uses: graalvm/setup-graalvm@v1 - with: - version: ${{ env.GRAALVM_VERSION }} - java-version: ${{ env.JAVA_VERSION }} - components: 'native-image' - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Build native distribution' - run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e - - - name: 'Upload daemon test logs' - if: always() - uses: actions/upload-artifact@v2 - with: - name: daemon-test-logs-${{ env.OS }} - path: integration-tests/target/mvnd-tests/**/daemon*.log - - release: - runs-on: ubuntu-18.04 - needs: [build] - - steps: - - name: 'Check out repository' - uses: actions/checkout@v2 - with: - # required for triggering release-candidate-stage2 - token: ${{ secrets.GIT_ACCESS_TOKEN }} - - - name: 'Set up Java' - uses: actions/setup-java@v2 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: 'zulu' - - - name: 'Cache Maven packages' - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: 'Release' - run: | - ./mvnw -B -ntp \ - -Drepository.url=https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git \ - release:prepare diff --git a/.github/workflows/release-candidate-stage2.yml b/.github/workflows/release-candidate-stage2.yml deleted file mode 100644 index cbd57e1e..00000000 --- a/.github/workflows/release-candidate-stage2.yml +++ /dev/null @@ -1,65 +0,0 @@ -# -# Copyright (c) 2017 Angelo Zerr and other contributors as -# indicated by the @author tags. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: Release Candidate - Stage2 - -# push on tag but not on 'early-access' -on: - push: - tags: - - '!early-access' - -env: - GRAALVM_VERSION: '21.3.0' - JAVA_VERSION: '17' - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - name: 'Check out repository' - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: 'Set up Java' - uses: actions/setup-java@v2 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: 'zulu' - - - name: 'Cache Maven packages' - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: 'Release to GitHub' - env: - JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./mvnw -B --file pom.xml -pl :mvnd -Pprerelease jreleaser:release - - - name: 'JReleaser output' - if: always() - uses: actions/upload-artifact@v2 - with: - name: jreleaser-logs - path: | - target/jreleaser/trace.log - target/jreleaser/output.properties diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a4b3ef79..9bc56d29 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,9 +17,13 @@ name: Release -# manual trigger on: + # manual trigger workflow_dispatch: + # build on new tags + push: + tags: + - '*' env: GRAALVM_VERSION: '21.3.0' @@ -55,14 +59,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: 'Build native distribution' - run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e - - - name: 'Upload daemon test logs' - if: always() - uses: actions/upload-artifact@v2 - with: - name: daemon-test-logs-${{ env.OS }} - path: integration-tests/target/mvnd-tests/**/daemon*.log + run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e -DskipTests - name: 'Upload artifact' uses: actions/upload-artifact@v2 @@ -70,9 +67,44 @@ jobs: name: artifacts path: dist/target/mvnd-*.zip + source: + name: 'Build source distributions' + runs-on: ubuntu-18.04 + steps: + - name: 'Check out repository' + uses: actions/checkout@v2 + + - name: 'Set vars' + shell: bash + run: | + OS=$(echo '${{ runner.os }}' | awk '{print tolower($0)}') + [[ $OS == 'ubuntu' ]] && echo "OS=linux" >> $GITHUB_ENV || echo "OS=$OS" >> $GITHUB_ENV + [[ $OS == 'macos' ]] && echo "OS=darwin" >> $GITHUB_ENV || echo "OS=$OS" >> $GITHUB_ENV + echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV + + - name: 'Set up Graal' + uses: graalvm/setup-graalvm@v1 + with: + version: ${{ env.GRAALVM_VERSION }} + java-version: ${{ env.JAVA_VERSION }} + components: 'native-image' + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: 'Build native distribution' + run: ./mvnw clean verify -Psource-distribution -pl :mvnd -Dmrm=false -B -ntp -e + + - name: 'Upload artifact' + uses: actions/upload-artifact@v2 + with: + name: artifacts + path: | + target/mvnd-*-src.zip + target/mvnd-*-src.tar.gz + + release: runs-on: ubuntu-18.04 - needs: [build] + needs: [build, source] steps: - name: 'Check out repository' @@ -96,19 +128,129 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: 'Release to GitHub' - env: - JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JRELEASER_HOMEBREW_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} - JRELEASER_SDKMAN_CONSUMER_KEY: ${{ secrets.SDKMAN_CONSUMER_KEY }} - JRELEASER_SDKMAN_CONSUMER_TOKEN: ${{ secrets.SDKMAN_CONSUMER_TOKEN }} - run: ./mvnw -B --file pom.xml -pl :mvnd -Prelease -DartifactsDir=artifacts jreleaser:full-release + - name: ls -R + run: ls -R - - name: 'JReleaser output' - if: always() - uses: actions/upload-artifact@v2 + - name: Set environment + run: | + echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV + + - name: Compute sha256 checksums + run: | + sha256sum artifacts/mvnd-${{ env.VERSION }}-linux-amd64.zip | cut -d ' ' -f 1 > artifacts/mvnd-${{ env.VERSION }}-linux-amd64.zip.sha256 + sha256sum artifacts/mvnd-${{ env.VERSION }}-darwin-amd64.zip | cut -d ' ' -f 1 > artifacts/mvnd-${{ env.VERSION }}-darwin-amd64.zip.sha256 + sha256sum artifacts/mvnd-${{ env.VERSION }}-windows-amd64.zip | cut -d ' ' -f 1 > artifacts/mvnd-${{ env.VERSION }}-windows-amd64.zip.sha256 + sha256sum artifacts/mvnd-${{ env.VERSION }}-src.zip | cut -d ' ' -f 1 > artifacts/mvnd-${{ env.VERSION }}-src.zip.sha256 + sha256sum artifacts/mvnd-${{ env.VERSION }}-src.tar.gz | cut -d ' ' -f 1 > artifacts/mvnd-${{ env.VERSION }}-src.tar.gz.sha256 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: jreleaser-logs - path: | - target/jreleaser/trace.log - target/jreleaser/output.properties + tag_name: ${{ env.VERSION }} + release_name: ${{ env.VERSION }} + draft: false + prerelease: false + + - name: Deploy mvnd-src.zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-src.zip + asset_name: mvnd-${{ env.VERSION }}-src.zip + asset_content_type: application/zip + + - name: Deploy mvnd-src.zip.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-src.zip.sha256 + asset_name: mvnd-${{ env.VERSION }}-src.zip.sha256 + asset_content_type: text/plain + + - name: Deploy mvnd-src.tar.gz + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-src.tar.gz + asset_name: mvnd-${{ env.VERSION }}-src.tar.gz + asset_content_type: application/tar.gz + + - name: Deploy mvnd-src.tar.gz.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-src.tar.gz.sha256 + asset_name: mvnd-${{ env.VERSION }}-src.tar.gz.sha256 + asset_content_type: text/plain + + - name: Deploy mvnd-linux-amd64.zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-linux-amd64.zip + asset_name: mvnd-${{ env.VERSION }}-linux-amd64.zip + asset_content_type: application/zip + + - name: Deploy mvnd-linux-amd64.zip.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-linux-amd64.zip.sha256 + asset_name: mvnd-${{ env.VERSION }}-linux-amd64.zip.sha256 + asset_content_type: text/plain + + - name: Deploy mvnd-darwin-amd64.zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-darwin-amd64.zip + asset_name: mvnd-${{ env.VERSION }}-darwin-amd64.zip + asset_content_type: application/zip + + - name: Deploy mvnd-darwin-amd64.zip.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-darwin-amd64.zip.sha256 + asset_name: mvnd-${{ env.VERSION }}-darwin-amd64.zip.sha256 + asset_content_type: text/plain + + - name: Deploy mvnd-windows-amd64.zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-windows-amd64.zip + asset_name: mvnd-${{ env.VERSION }}-windows-amd64.zip + asset_content_type: application/zip + + - name: Deploy mvnd-windows-amd64.zip.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/mvnd-${{ env.VERSION }}-windows-amd64.zip.sha256 + asset_name: mvnd-${{ env.VERSION }}-windows-amd64.zip.sha256 + asset_content_type: text/plain + diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml deleted file mode 100644 index 4f1f176d..00000000 --- a/.github/workflows/update-changelog.yml +++ /dev/null @@ -1,54 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -name: Mvnd Changelog - -on: - workflow_dispatch: - schedule: - # Run at 3 during night - - cron: '0 3 * * *' - -jobs: - generate_changelog: - runs-on: ubuntu-latest - name: Generate changelog for master branch - steps: - - uses: actions/checkout@v1 - - - name: Generate changelog - uses: charmixer/auto-changelog-action@v1.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Commit files - env: - CI_USER: "github-actions[bot]" - CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" - run: | - git config --local user.email "$CI_EMAIL" - git config --local user.name "$CI_USER" - git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && $(echo "push=1" >> $GITHUB_ENV) || echo "No changes to CHANGELOG.md" - - - name: Push changes - if: env.push == 1 - env: - CI_USER: "github-actions[bot]" - CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" - CI_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master diff --git a/build/release.sh b/build/release.sh index b3b3a42c..8eefc7be 100755 --- a/build/release.sh +++ b/build/release.sh @@ -25,11 +25,14 @@ git checkout master git fetch upstream git reset --hard upstream/master mvn versions:set -DnewVersion=$VERSION +docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator \ + --user apache --project maven-mvnd --token GITHUB_TOKEN git add -A -git commit -m "Release $VERSION" +git commit -m "[release] Release $VERSION" git tag $VERSION git push upstream $VERSION -# Pushing a tag will trigger the CI to build the release and publish the artifacts on https://github.com/mvndaemon/mvnd/releases +# Pushing a tag will trigger the CI to build the release and publish +# the artifacts on https://github.com/mvndaemon/mvnd/releases mvn versions:set -DnewVersion=$NEXT_VERSION git add -A diff --git a/pom.xml b/pom.xml index c7e3ba79..073262f6 100644 --- a/pom.xml +++ b/pom.xml @@ -77,15 +77,6 @@ 1.13.9 1.0.19 - 1.0.0 - false - ALWAYS - ALWAYS - false - false - NEVER - NEVER - 3.27.0-GA @@ -550,127 +541,35 @@ limitations under the License. - - - org.jreleaser - jreleaser-maven-plugin - ${jreleaser.version} - false - - - - - dist/target - - - - mvnd - Maven Daemon - Apache-2.0 - https://github.com/mvndaemon/mvnd - The Maven project - maven,mvn,daemon,graalvm - - - - master - true - {{projectVersion}} - {{projectVersion}} - - ${jreleaser.prerelease} - - ${jreleaser.overwrite} - - ${jreleaser.update} - - ${jreleaser.upload.assets} - - ALWAYS - - {{commitShortHash}} {{commitTitle}} - - - {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}} - - - - - Updated CHANGELOG.md - - - - - changelog - changelog - update-changelog - - - - changelog - GitHub,bot - - - - - - - NATIVE_IMAGE - ${jreleaser.distribution.active} - - - {{artifactsDir}}/mvnd-{{projectVersion}}-linux-amd64.zip - linux-x86_64 - - - {{artifactsDir}}/mvnd-{{projectVersion}}-windows-amd64.zip - windows-x86_64 - - - {{artifactsDir}}/mvnd-{{projectVersion}}-darwin-amd64.zip - osx-x86_64 - - - - ${jreleaser.brew.active} - true - - mvndaemon - homebrew-mvnd - Release {{tagName}} - - - - ${jreleaser.sdkman.active} - - - - - - - prerelease - - true - PRERELEASE - NEVER - false - false - - - - release - - false - RELEASE - ALWAYS - false - true - RELEASE - RELEASE - + source-distribution + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.3.0 + + + create-source-distribution + package + + single + + + + src/main/assembly/src.xml + + + + + + + diff --git a/src/main/assembly/src.xml b/src/main/assembly/src.xml new file mode 100644 index 00000000..c9d5b2e7 --- /dev/null +++ b/src/main/assembly/src.xml @@ -0,0 +1,58 @@ + + + + src + + zip + tar.gz + + + + ${project.basedir} + / + + %regex[(?!((?!target/)[^/]+/)*src/).*target.*] + **/*.log + **/.gitignore + **/.gitattributes + init-git-svn.sh + **/.repository/** + **/.classpath + **/.project + **/.settings/** + **/*.iml + **/*.ipr + **/.idea/** + **/.DS_Store + **/build/** + + + + ${project.build.directory}/maven-shared-archive-resources/META-INF + / + + DEPENDENCIES + + + + + +