diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e15d01cd3..a1da280ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest ] - java: [ 17, 14, 11 ] + java: [ 17, 11 ] experimental: [ false ] include: # Only test on macos and windows with a single recent JDK to avoid a diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 689f33947..08619cd8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,39 +11,49 @@ jobs: build-maven-jars: runs-on: ubuntu-latest permissions: - contents: read + contents: write steps: - name: Setup Signing Key run: | - cat <(echo -e "${{ secrets.GPG_SIGNING_KEY }}") | gpg --batch --import + gpg-agent --daemon --default-cache-ttl 7200 + echo -e "${{ secrets.GPG_SIGNING_KEY }}" | gpg --batch --import --no-tty + echo "hello world" > temp.txt + gpg --detach-sig --yes -v --output=/dev/null --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSPHRASE }}" temp.txt + rm temp.txt gpg --list-secret-keys --keyid-format LONG - name: Checkout - uses: actions/checkout@2.4.0 + uses: actions/checkout@v2.4.0 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v2.5.0 with: java-version: 17 distribution: 'zulu' cache: 'maven' - name: Bump Version Number - env: - NEW_VERSION: ${{ github.events.input.version }} run: | - mvn versions:set versions:commit -DnewVersion="${NEW_VERSION}" + mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}" + mvn tycho-versions:update-eclipse-metadata -pl eclipse_plugin git ls-files | grep 'pom.xml$' | xargs git add - git commit -m "Release google-java-format ${NEW_VERSION}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + git config --global user.name "${{ github.actor }}" + git commit -m "Release google-java-format ${{ github.event.inputs.version }}" + echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV + git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/google-java-format.git git push - + - name: Build Jars - run: mvn clean verify gpg:sign -DskipTests=true -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" + run: mvn --no-transfer-progress clean verify gpg:sign -DskipTests=true -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" - name: Add Jars to Release Entry - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v0.1.14 with: draft: true - name: ${{ github.events.input.version }} - tag_name: "v${{ github.events.input.version }}" - files: core/target/google-java-format-*.jar + name: ${{ github.event.input.version }} + tag_name: "v${{ github.event.inputs.version }}" + target_commitish: ${{ env.TARGET_COMMITISH }} + files: | + core/target/google-java-format-*.jar + eclipse_plugin/target/google-java-format-eclipse-plugin-*.jar diff --git a/eclipse_plugin/pom.xml b/eclipse_plugin/pom.xml index ee5635c42..bf3ef3d60 100644 --- a/eclipse_plugin/pom.xml +++ b/eclipse_plugin/pom.xml @@ -32,7 +32,7 @@ UTF-8 - 1.7.0 + 2.6.0 diff --git a/pom.xml b/pom.xml index 95fb8f68c..5d768de79 100644 --- a/pom.xml +++ b/pom.xml @@ -27,10 +27,7 @@ core - Google Java Format Parent