|
| 1 | +# This workflow will build a package using Maven and then publish it to GitHub packages when a PR is accepted/new content is pushed |
| 2 | +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path |
| 3 | + |
| 4 | +name: Maven Publish Snapshot |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - development |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + |
| 14 | + runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + contents: read |
| 17 | + packages: write |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + - name: Set up JDK 11 |
| 22 | + uses: actions/setup-java@v2 |
| 23 | + with: |
| 24 | + java-version: '11' |
| 25 | + distribution: 'adopt' |
| 26 | + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml |
| 27 | + settings-path: ${{ github.workspace }} # location for the settings.xml file |
| 28 | + |
| 29 | + - name: Build with Maven |
| 30 | + run: mvn -B package --file pom.xml |
| 31 | + |
| 32 | + - name: Delete old dataformat-parent package |
| 33 | + uses: actions/delete-package-versions@v1 |
| 34 | + continue-on-error: true |
| 35 | + with: |
| 36 | + package-name: 'io.admin-shell.aas.dataformat-parent' |
| 37 | + |
| 38 | + - name: Delete old dataformat-core package |
| 39 | + uses: actions/delete-package-versions@v1 |
| 40 | + continue-on-error: true |
| 41 | + with: |
| 42 | + package-name: 'io.admin-shell.aas.dataformat-core' |
| 43 | + |
| 44 | + - name: Delete old dataformat-aasx package |
| 45 | + uses: actions/delete-package-versions@v1 |
| 46 | + continue-on-error: true |
| 47 | + with: |
| 48 | + package-name: 'io.admin-shell.aas.dataformat-aasx' |
| 49 | + |
| 50 | + - name: Delete old dataformat-xml package |
| 51 | + uses: actions/delete-package-versions@v1 |
| 52 | + continue-on-error: true |
| 53 | + with: |
| 54 | + package-name: 'io.admin-shell.aas.dataformat-xml' |
| 55 | + |
| 56 | + - name: Delete old dataformat-aml package |
| 57 | + uses: actions/delete-package-versions@v1 |
| 58 | + continue-on-error: true |
| 59 | + with: |
| 60 | + package-name: 'io.admin-shell.aas.dataformat-aml' |
| 61 | + |
| 62 | + - name: Delete old dataformat-rdf package |
| 63 | + uses: actions/delete-package-versions@v1 |
| 64 | + continue-on-error: true |
| 65 | + with: |
| 66 | + package-name: 'io.admin-shell.aas.dataformat-rdf' |
| 67 | + |
| 68 | + - name: Delete old dataformat-json package |
| 69 | + uses: actions/delete-package-versions@v1 |
| 70 | + continue-on-error: true |
| 71 | + with: |
| 72 | + package-name: 'io.admin-shell.aas.dataformat-json' |
| 73 | + |
| 74 | + - name: Delete old validator package |
| 75 | + uses: actions/delete-package-versions@v1 |
| 76 | + continue-on-error: true |
| 77 | + with: |
| 78 | + package-name: 'io.admin-shell.aas.validator' |
| 79 | + |
| 80 | + - name: Publish to GitHub Packages Apache Maven |
| 81 | + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml |
| 82 | + env: |
| 83 | + GITHUB_TOKEN: ${{ github.token }} |
0 commit comments