fix(deps): update dependency org.apache.commons:commons-text to v1.13… #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '**' | |
permissions: {} | |
jobs: | |
build: | |
permissions: | |
contents: write # to push pages branch (peaceiris/actions-gh-pages) | |
if: github.repository_owner == 'spotbugs' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get previous tag for the change log | |
id: previousTag | |
run: | | |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1) | |
echo "previousTag: $name" | |
echo "previousTag=$name" >> $GITHUB_ENV | |
- name: Update CHANGELOG | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
token: ${{ github.token }} | |
toTag: ${{ env.previousTag }} | |
fromTag: ${{ github.ref_name }} | |
writeToFile: true | |
continue-on-error: true | |
- name: Commit CHANGELOG.md | |
if: (github.ref_type == 'tag') && (github.event.base_ref == 'refs/heads/master') | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: ${{ github.base_ref}} | |
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }}' | |
file_pattern: CHANGELOG.md | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: temurin | |
cache: gradle | |
- uses: gradle/actions/wrapper-validation@v4 | |
- name: Download Eclipse | |
run: | | |
curl -L 'https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.24-202206070700/eclipse-SDK-4.24-linux-gtk-x86_64.tar.gz&mirror_id=1' --output eclipse-SDK-4.24-linux-gtk-x86_64.tar.gz | |
tar xzvf eclipse-SDK-4.24-linux-gtk-x86_64.tar.gz eclipse | |
echo "eclipseRoot.dir=$(pwd)/eclipse" > eclipsePlugin/local.properties | |
- name: Build on tag | |
if: (github.ref_type == 'tag') && (github.event.base_ref == 'refs/heads/master') | |
run: | | |
gpg --quiet --batch --yes --decrypt --passphrase="$GPG_SECRET_PASSPHRASE" --output spotbugs.jks .github/workflows/spotbugs.jks.gpg | |
echo "sonatypeUsername=${SONATYPE_USERNAME}" >> gradle.properties | |
echo "sonatypePassword=${SONATYPE_PASSWORD}" >> gradle.properties | |
echo "keystorepass=${KEYSTORE_PASS}" >> gradle.properties | |
./gradlew assemble publishToSonatype closeAndReleaseSonatypeStagingRepository createReleaseBody --no-daemon | |
env: | |
GPG_SECRET_PASSPHRASE: ${{ secrets.GPG_SECRET_PASSPHRASE }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }} | |
- name: Build otherwise | |
if: ${{ !((github.ref_type == 'tag') && (github.event.base_ref == 'refs/heads/master')) }} | |
run: | | |
gpg --quiet --batch --yes --decrypt --passphrase="$GPG_SECRET_PASSPHRASE" --output spotbugs.jks .github/workflows/spotbugs.jks.gpg | |
echo "sonatypeUsername=${SONATYPE_USERNAME}" >> gradle.properties | |
echo "sonatypePassword=${SONATYPE_PASSWORD}" >> gradle.properties | |
echo "keystorepass=${KEYSTORE_PASS}" >> gradle.properties | |
./gradlew assemble publishToSonatype createReleaseBody --no-daemon | |
env: | |
GPG_SECRET_PASSPHRASE: ${{ secrets.GPG_SECRET_PASSPHRASE }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }} | |
- name: Deploy eclipse-latest | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
external_repository: spotbugs/eclipse-latest | |
personal_token: ${{ secrets.PERSONAL_TOKEN_FOR_PAGES }} | |
publish_branch: gh-pages | |
publish_dir: ./eclipsePlugin/build/site/eclipse-daily | |
- name: Deploy eclipse-candidate | |
uses: peaceiris/actions-gh-pages@v4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
external_repository: spotbugs/eclipse-candidate | |
personal_token: ${{ secrets.PERSONAL_TOKEN_FOR_PAGES }} | |
publish_branch: gh-pages | |
publish_dir: ./eclipsePlugin/build/site/eclipse-candidate | |
- name: Deploy eclipse | |
uses: peaceiris/actions-gh-pages@v4 | |
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '_RC') && !contains(github.ref, '_beta') | |
with: | |
external_repository: spotbugs/eclipse | |
personal_token: ${{ secrets.PERSONAL_TOKEN_FOR_PAGES }} | |
publish_branch: gh-pages | |
publish_dir: ./eclipsePlugin/build/site/eclipse | |
- name: Get the version | |
if: startsWith(github.ref, 'refs/tags/') | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
- name: Create draft Release | |
# attach zip, tgz and eclipse plugin to the GitHub Release | |
# https://github.com/github/hub#github-actions | |
# https://github.com/actions/upload-release-asset/issues/28#issuecomment-617208601 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: (github.ref_type == 'tag') | |
run: | | |
set -x | |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | |
assets=("-a" "./eclipsePlugin/build/distributions/eclipsePlugin.zip") | |
for asset in ./spotbugs/build/distributions/*; do | |
assets+=("-a" "$asset") | |
done | |
bin/hub release create "${assets[@]}" -F build/release.md "${{ steps.get_version.outputs.VERSION }}" --draft | |
- name: Publish draft Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: (github.ref_type == 'tag') && (github.event.base_ref == 'refs/heads/master') | |
run: | | |
bin/hub release edit ${{ github.ref_name }} --draft=false |