1.5.0 #51
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| release: | |
| types: [ published ] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| Release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'maven' | |
| - name: Prepare Environment | |
| run: chmod +x mvnw | |
| - name: Set Release Version | |
| run: | | |
| ./mvnw --batch-mode versions:set -DnewVersion="${{ github.ref_name }}" | |
| ./mvnw --batch-mode versions:commit | |
| - name: Build Reactor | |
| run: ./mvnw --batch-mode -pl '!addon,!showcase' install | |
| - name: Build Add-on | |
| run: ./mvnw --batch-mode -Pdirectory -pl :addon install | |
| - name: Build Showcase | |
| run: ./mvnw --batch-mode -Pproduction -pl :showcase install | |
| - name: Deploy Add-on to GitHub releases | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| asset_path: addon/target/minicalendar-${{ github.ref_name }}.zip | |
| asset_name: minicalendar-${{ github.ref_name }}.zip | |
| asset_content_type: application/zip | |
| upload_url: ${{ github.event.release.upload_url }} | |
| - name: Deploy Showcase to GitHub releases | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| asset_path: showcase/target/minicalendar-showcase-${{ github.ref_name }}.war | |
| asset_name: minicalendar-showcase-${{ github.ref_name }}.war | |
| asset_content_type: application/java-archive | |
| upload_url: ${{ github.event.release.upload_url }} | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: ./showcase | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |