|
1 |
| -name: Triggered Release |
2 |
| -on: |
3 |
| - workflow_dispatch: |
4 |
| - inputs: |
5 |
| - releaseVersion: |
6 |
| - description: 'Default version to use when preparing a release or a branch.' |
7 |
| - required: true |
8 |
| - developmentVersion: |
9 |
| - description: 'Default version to use for new local working copy.' |
10 |
| - required: true |
11 | 1 | env:
|
12 |
| - OSS_USERNAME: ${{ secrets.OSS_USERNAME }} |
13 |
| - OSS_PASSWORD: ${{ secrets.OSS_PASSWORD }} |
14 | 2 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
| 3 | + OSS_PASSWORD: ${{ secrets.OSS_PASSWORD }} |
| 4 | + OSS_USERNAME: ${{ secrets.OSS_USERNAME }} |
15 | 5 | jobs:
|
16 |
| - release: |
17 |
| - runs-on: ubuntu-latest |
18 |
| - steps: |
19 |
| - - uses: actions/checkout@v4 |
20 |
| - - name: Set up JDK 11 |
21 |
| - uses: actions/setup-java@v4 |
22 |
| - with: |
23 |
| - distribution: 'zulu' |
24 |
| - java-version: 11 |
25 |
| - cache: 'maven' |
26 |
| - # Value of the distributionManagement/repository/id field of the pom.xml |
27 |
| - server-id: sonatype-nexus-staging |
28 |
| - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} |
29 |
| - server-username: OSS_USERNAME |
30 |
| - server-password: OSS_PASSWORD |
31 |
| - gpg-passphrase: GPG_PASSPHRASE |
32 |
| - - name: Setup Git |
33 |
| - run: | |
34 |
| - git config --global committer.email "noreply@github.com" |
35 |
| - git config --global committer.name "GitHub Release" |
36 |
| - git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com" |
37 |
| - git config --global author.name "${GITHUB_ACTOR}" |
38 |
| - - name: Release |
39 |
| - run: ./mvnw -V -B -ntp -Prelease -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} release:prepare release:perform |
40 |
| - - name: Rollback on failure |
41 |
| - if: ${{ failure() }} |
42 |
| - run: | |
43 |
| - ./mvnw -B release:rollback -Prelease -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}} |
44 |
| - echo "You may need to manually delete the GitHub tag, if it was created." |
45 | 6 | docker:
|
46 | 7 | needs: release
|
47 |
| - runs-on: ubuntu-latest |
| 8 | + runs-on: self-hosted |
| 9 | + steps: |
| 10 | + - continue-on-error: true |
| 11 | + uses: actions/checkout@v4 |
| 12 | + with: |
| 13 | + ref: ${{ github.event.inputs.releaseVersion }} |
| 14 | + - continue-on-error: true |
| 15 | + name: Set up QEMU |
| 16 | + uses: docker/setup-qemu-action@v3 |
| 17 | + - continue-on-error: true |
| 18 | + name: Set up Docker Buildx |
| 19 | + uses: docker/setup-buildx-action@v3 |
| 20 | + - continue-on-error: true |
| 21 | + name: Login to DockerHub |
| 22 | + uses: docker/login-action@v3 |
| 23 | + with: |
| 24 | + password: ${{ secrets.DOCKER_HUB_PASSWORD }} |
| 25 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 26 | + - continue-on-error: true |
| 27 | + name: Build & Push Docker image |
| 28 | + uses: docker/build-push-action@v5 |
| 29 | + with: |
| 30 | + context: . |
| 31 | + platforms: linux/amd64,linux/arm64 |
| 32 | + push: false |
| 33 | + tags: 'openapitools/openapi-diff:${{ github.event.inputs.releaseVersion }} |
| 34 | +
|
| 35 | + openapitools/openapi-diff:latest |
| 36 | +
|
| 37 | + ' |
| 38 | + release: |
| 39 | + runs-on: self-hosted |
48 | 40 | steps:
|
49 |
| - - uses: actions/checkout@v4 |
50 |
| - with: |
51 |
| - ref: ${{ github.event.inputs.releaseVersion }} |
52 |
| - - name: Set up QEMU |
53 |
| - uses: docker/setup-qemu-action@v3 |
54 |
| - - name: Set up Docker Buildx |
55 |
| - uses: docker/setup-buildx-action@v3 |
56 |
| - - name: Login to DockerHub |
57 |
| - uses: docker/login-action@v3 |
58 |
| - with: |
59 |
| - username: ${{ secrets.DOCKER_HUB_USERNAME }} |
60 |
| - password: ${{ secrets.DOCKER_HUB_PASSWORD }} |
61 |
| - - name: Build & Push Docker image |
62 |
| - uses: docker/build-push-action@v5 |
63 |
| - with: |
64 |
| - context: . |
65 |
| - push: true |
66 |
| - platforms: linux/amd64,linux/arm64 |
67 |
| - tags: | |
68 |
| - openapitools/openapi-diff:${{ github.event.inputs.releaseVersion }} |
69 |
| - openapitools/openapi-diff:latest |
| 41 | + - continue-on-error: true |
| 42 | + uses: actions/checkout@v4 |
| 43 | + - continue-on-error: true |
| 44 | + name: Set up JDK 11 |
| 45 | + uses: actions/setup-java@v4 |
| 46 | + with: |
| 47 | + cache: maven |
| 48 | + distribution: zulu |
| 49 | + gpg-passphrase: GPG_PASSPHRASE |
| 50 | + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 51 | + java-version: 11 |
| 52 | + server-id: sonatype-nexus-staging |
| 53 | + server-password: OSS_PASSWORD |
| 54 | + server-username: OSS_USERNAME |
| 55 | + - continue-on-error: true |
| 56 | + name: Setup Git |
| 57 | + run: 'git config --global committer.email "noreply@github.com" |
| 58 | +
|
| 59 | + git config --global committer.name "GitHub Release" |
| 60 | +
|
| 61 | + git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com" |
| 62 | +
|
| 63 | + git config --global author.name "${GITHUB_ACTOR}" |
| 64 | +
|
| 65 | + ' |
| 66 | + - continue-on-error: true |
| 67 | + name: Release |
| 68 | + run: ./mvnw -V -B -ntp -Prelease -DreleaseVersion=${{ github.event.inputs.releaseVersion |
| 69 | + }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} release:prepare |
| 70 | + release:perform |
| 71 | + - continue-on-error: true |
| 72 | + if: ${{ failure() }} |
| 73 | + name: Rollback on failure |
| 74 | + run: './mvnw -B release:rollback -Prelease -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}} |
| 75 | +
|
| 76 | + echo "You may need to manually delete the GitHub tag, if it was created." |
| 77 | +
|
| 78 | + ' |
| 79 | +name: Triggered Release |
| 80 | +on: |
| 81 | + repository_dispatch: |
| 82 | + types: trigger-ga___release.yml |
0 commit comments