diff --git a/.github/workflows/ci.yml b/.github/workflows/build-test-deploy.yml similarity index 74% rename from .github/workflows/ci.yml rename to .github/workflows/build-test-deploy.yml index 94140382..ebe54589 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build-test-deploy.yml @@ -1,7 +1,12 @@ -name: SDK Kotlin CI +name: Build, Test, and Deploy SNAPSHOT on: workflow_dispatch: + inputs: + version: + description: 'Version to publish. For example "1.0.0-SNAPSHOT". If not supplied, will default to version specified in the POM.' + required: false + default: '0.0.0-SNAPSHOT' push: branches: - issue-217/maven-build @@ -37,8 +42,23 @@ jobs: if ! which sha256sum; then brew install coreutils; fi sha256sum $(find test-vectors -name '*.json') > test-vector-hashes.txt - - name: Run Maven Build - run: mvn --batch-mode verify + - name: Build, Test, and Deploy SNAPSHOT + run: | + if [ -n "${{ github.event.inputs.version }}" ]; then + mvn \ + deploy \ + --batch-mode \ + --settings .maven_settings.xml \ + -Dversion=${{ github.event.inputs.version }} + else + mvn \ + deploy \ + --batch-mode \ + --settings .maven_settings.xml + fi + env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} # Upload Web5 Vector test resultsß - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml deleted file mode 100644 index baa5eb50..00000000 --- a/.github/workflows/publish-snapshot.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Publish SNAPSHOT to TBD Artifactory -on: - workflow_dispatch: - inputs: - version: - description: 'Version to publish. For example "1.0.0-SNAPSHOT". If not supplied, will default to version specified in the POM.' - required: false - default: '0.0.0-SNAPSHOT' - push: - branches: - - issue-217/maven-build -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - # https://cashapp.github.io/hermit/usage/ci/ - - name: Init Hermit - uses: cashapp/activate-hermit@v1 - - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - # This will publish to TBD Artifactory. Does not release to Maven Central. - # Skips testing as this workflow is triggered after CI where tests have already run - - name: Publish SNAPSHOT to TBD Artifactory - run: | - if [ -n "${{ github.event.inputs.version }}" ]; then - mvn \ - deploy \ - -DskipTests=true \ - --batch-mode \ - --settings .maven_settings.xml \ - -Dversion=${{ github.event.inputs.version }} - else - mvn \ - deploy \ - -DskipTests=true \ - --batch-mode \ - --settings .maven_settings.xml - fi - env: - ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} - ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}