diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..d24fc84 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +.github/* @DOI-BOR/bdo-wtmp +.github/workflows/* @DOI-BOR/bdo-wtmp \ No newline at end of file diff --git a/.github/workflows/publish_build.yml b/.github/workflows/publish_build.yml new file mode 100644 index 0000000..4e1bf37 --- /dev/null +++ b/.github/workflows/publish_build.yml @@ -0,0 +1,33 @@ +name: Publish with Gradle + +permissions: + contents: read + packages: write + +# this should only be triggered manually +on: workflow_dispatch + +jobs: + build: + # run on windows to mimic local build + runs-on: windows-latest + + steps: + - name: Checkout repository + # checkout action hash for version 6.0.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + + - name: Set up Java + # setup-java action hash for version 5.2.0 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 + with: + # Gradle needs java 17 or above + java-version: '17' + distribution: 'temurin' + - name: Publish with Gradle wrapper command + # this run will do the publishing with the wrapper already provided in the repository + run: ./gradlew.bat publish + # these are the credentials we will need + env: + GITHUB_ACTOR: ${{ secrets.PACKAGES_USER }} + GITHUB_TOKEN: ${{ secrets.PACKAGES_PAT }} diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml new file mode 100644 index 0000000..5d05797 --- /dev/null +++ b/.github/workflows/test_build.yml @@ -0,0 +1,31 @@ +name: Test Build with Gradle + + +on: + push: + branches: [ "main", "master" ] + pull_request: + branches: [ "main", "master" ] + + +jobs: + build: + # run on windows to mimic local build + runs-on: windows-latest + + steps: + - name: Checkout repository + # checkout action hash for version 6.0.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + + - name: Set up Java + # setup-java action hash for version 5.2.0 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 + with: + # Gradle needs java 17 or above + java-version: '17' + distribution: 'temurin' + + - name: Build with Gradle wrapper command + # this run will do the build with the wrapper already provided in the repository + run: ./gradlew.bat build diff --git a/build.gradle b/build.gradle index 621194b..0feeefb 100644 --- a/build.gradle +++ b/build.gradle @@ -88,4 +88,16 @@ publishing { artifact source: tasks.named("zipPython"), extension: 'zip' } } + + // publish to github packages + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/DOI-BOR/WTMP-Python-Plotting") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } } \ No newline at end of file