|
| 1 | +name: Upload Release Assets |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 146-Migrate-maven-repository ] |
| 6 | + paths-ignore: |
| 7 | + - '**.md' |
| 8 | + - '**.py' |
| 9 | + - 'Dockerfile' |
| 10 | + - '.gitignore' |
| 11 | + - 'LICENSE' |
| 12 | + - 'docker.yml' |
| 13 | + - 'formatting.yml' |
| 14 | + - 'test_pack_dock.yml' |
| 15 | + - 'triage.yml' |
| 16 | + - 'acceptance_test.yml' |
| 17 | + - 'web/**' |
| 18 | + - '.github/workflows/**' |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +env: |
| 22 | + java_version: '17' |
| 23 | + java_distribution: 'zulu' |
| 24 | + |
| 25 | +jobs: |
| 26 | + publish-snapshots: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: Set up JDK ${{ env.java_version }}-${{ env.java_distribution }} |
| 33 | + uses: actions/setup-java@v3 |
| 34 | + with: |
| 35 | + java-version: ${{ env.java_version }} |
| 36 | + distribution: ${{ env.java_distribution }} |
| 37 | + |
| 38 | + # The following steps will publish artifacts to a sonatype staging repo with the aim of promoting them to maven central |
| 39 | + # Pretty much everything is done through gradle. |
| 40 | + # The version used will be according to the axion-release-plugin, meaning it will take a tag if present. |
| 41 | + # The tag should follow semantic versioning, e.g. v1.2.3. There could be a suffix, e.g. v1.2.3-TEST |
| 42 | + # gradle will build, sign then upload artifacts to a Sonatype staging repo. |
| 43 | + # See https://s01.oss.sonatype.org for accessing these repos. |
| 44 | + # At this point it should manually be closed, which will trigger acceptance tests for maven central (but not transfer yet) |
| 45 | + # Once closed, the repo is available for testing. |
| 46 | + # After testing, it can be manually promoted on the sonatype site, which will then publish to maven central. |
| 47 | + # Note than once in maven central a release cannot be removed or altered. |
| 48 | + |
| 49 | + - name: Load secrets from 1Password |
| 50 | + id: onepw_secrets |
| 51 | + uses: ./.github/actions/extract-1password-secret |
| 52 | + with: |
| 53 | + OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} # This is required to connect to the vault in our 1Password account. |
| 54 | + VARIABLES_TO_EXTRACT: 'MAVEN_GPG_PASSPHRASE, MAVEN_GPG_PRIVATE_KEY, MAVEN_CENTRAL_PORTAL_TOKEN_USERNAME, MAVEN_CENTRAL_PORTAL_TOKEN_PASSWORD' |
| 55 | + ONE_PASSWORD_SECRET_REFERENCES: ${{ vars.ONE_PASSWORD_SECRET_REFERENCES }} |
| 56 | + |
| 57 | + - name: Build and Publish to Sonatype |
| 58 | + run: | |
| 59 | + ./gradlew publish --rerun-tasks |
| 60 | +
|
0 commit comments