ci: deploy master snapshots to OSSRH
MODIFY
.github/workflows/verify.yaml
.github/workflows/verify.yaml
name: Verify Build Workflow
on:
+ workflow_dispatch:
schedule:
- cron: '0 23 * * *'
push:
@@ -38,3 +39,37 @@ jobs:
run: mvn clean install -Dinvoker.skip -Dmaven.javadoc.skip=true -Dmvn.skip.test=true -DskipTests=true
- name: Run Tests
run: mvn test install -Dinvoker.skip -Dmaven.javadoc.skip=true
+
+ publish-snapshots:
+ name: Publish master snapshot artifacts
+ runs-on: ubuntu-latest
+ if: github.ref == 'refs/heads/master' && github.repository_owner == 'Apiman'
+ needs: [ build-verify ]
+
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v2
+
+ - name: Cache local Maven repository
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+ - name: Set up JDK 8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 8
+ server-id: ossrh
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_PASSWORD
+
+ - name: 'Apiman: Build and Publish Docker Images & Deploy OSSRH Snapshots'
+ run: |
+ ./mvnw -B clean install
+ ./mvnw -B deploy -DskipTests -Dmaven.test.skip=true
+ env:
+ MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
+ MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ci: deploy master snapshots to OSSRH