Skip to content

Commit

Permalink
use github for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
icrc-fdeniger committed Jul 4, 2024
1 parent 1f258d4 commit ccff153
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 45 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Verify on PRs

on:
pull_request:
branches: [1.6.x]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
23 changes: 0 additions & 23 deletions .github/workflows/build_publish.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# this build is designed to replicate the Travis CI workflow
name: Deploy SNAPSHOT Version on Main branch

on:
push:
branches: [1.6.x]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: Deploy SNAPSHOT with Maven
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Do Release

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
server-id: github
- name: Git Config
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
- name: Remove snapshot
run: mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
- name: Release with Maven
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git tag
run: |
CURRENT_PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
git commit -a -m "[skip ci] release $CURRENT_PROJECT_VERSION"
git tag "$CURRENT_PROJECT_VERSION"
git push origin "$CURRENT_PROJECT_VERSION"
gh release create $CURRENT_PROJECT_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Move to next snapshot
run: mvn versions:set -DnextSnapshot=true -DgenerateBackupPoms=false

- name: Create Branch for next Snapshot Version
run: |
CURRENT_PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
BRANCH_NAME="move-to-$CURRENT_PROJECT_VERSION"
git checkout -b "$BRANCH_NAME"
git commit -a -m "[skip ci] change version to new snapshot $CURRENT_PROJECT_VERSION"
git push origin "$BRANCH_NAME"
gh pr create -B main -H $BRANCH_NAME --title "Update Version to $CURRENT_PROJECT_VERSION" --body 'Created by "Do Release" workflow'
echo "Please, accept the PR: Update Version to $CURRENT_PROJECT_VERSION"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 0 additions & 22 deletions .github/workflows/validate_pr.yml

This file was deleted.

0 comments on commit ccff153

Please sign in to comment.