Merge pull request #53 from opt-nc/dependabot/maven/develop/org.apach… #46
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
name: Test, release | |
on: | |
push: | |
branches: [main, develop] | |
jobs: | |
test-release-deploy: | |
name: Test, Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: 🧪 Test with Maven | |
run: mvn -B verify | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: ⚙️ Semantic Release | |
id: release | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
extra_plugins: | | |
@semantic-release/exec | |
conventional-changelog-conventionalcommits | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 👍 Merge main back to dev | |
if: github.ref == 'refs/heads/main' && steps.release.outputs.new_release_published == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git fetch | |
git checkout develop | |
git branch --set-upstream-to=origin/develop develop | |
git pull | |
git merge --no-ff main -m "Auto-merge main back to dev" | |
git push | |
- name: 🧹 Delete pre-releases | |
if: github.ref == 'refs/heads/main' && steps.release.outputs.new_release_published == 'true' | |
uses: dev-drprasad/delete-older-releases@v0.3.1 | |
with: | |
delete_tag_pattern: develop | |
keep_latest: 0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |