diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a562b15 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,19 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + uses: openmrs/openmrs-contrib-gha-workflows/.github/workflows/build-backend-module.yml@main + with: + java_versions: '["8", "11", "17", "21"]' + main_java_version: '8' + secrets: + NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }} + MAVEN_REPO_API_KEY: ${{ secrets.MAVEN_REPO_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 4d755e0..0000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Build with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - workflow_dispatch: - -jobs: - build: - strategy: - matrix: - platform: [ ubuntu-latest ] - java-version: [ 8, 11, 17, 21 ] - - runs-on: ${{ matrix.platform }} - env: - PLATFORM: ${{ matrix.platform }} - JAVA_VERSION: ${{ matrix.java-version }} - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java-version }} - distribution: 'temurin' - cache: 'maven' - - name: Install dependencies - run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --file pom.xml - - name: Build with Maven - run: mvn test --batch-mode --file pom.xml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fb14bb..43aa1e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,34 +1,30 @@ -on: - push: - tags: - - '*' # Create release for every new tag +name: Release -name: Create Release +on: + workflow_dispatch: + inputs: + release_version: + description: 'Release version (e.g., 1.3.3)' + required: true + development_version: + description: 'Next development version (e.g., 1.4.0-SNAPSHOT)' + required: true + branch: + description: 'Branch to release from (e.g., master)' + required: false + default: 'master' jobs: - build: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Create Release Notes - uses: openmrs/openmrs-contrib-create-release-notes@v1.0.3 - id: create-release-notes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - head-ref: ${{ github.ref }} - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body: | - ## What's Changed - ${{ steps.create-release-notes.outputs.release-notes }} - draft: false - prerelease: false + release: + uses: openmrs/openmrs-contrib-gha-workflows/.github/workflows/release-backend-module.yml@main + permissions: + contents: write + with: + release_version: ${{ inputs.release_version }} + development_version: ${{ inputs.development_version }} + branch: ${{ inputs.branch }} + java_version: '8' + secrets: + MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }} + MAVEN_REPO_API_KEY: ${{ secrets.MAVEN_REPO_API_KEY }} + BOT_PAT: ${{ secrets.BOT_PAT }} \ No newline at end of file