Version 0.9.23 #24
Workflow file for this run
This file contains 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: 'Publish to the Vaadin Directory' | |
on: | |
release: | |
types: [published] | |
jobs: | |
validation-build: | |
uses: samie/nps/.github/workflows/validation-build.yml@v24 | |
publish: | |
needs: [validation-build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Initialize environment | |
id: init-environment | |
run: | | |
( cd addon && mvn versions:set -DnewVersion=${{github.ref_name}} ) | |
echo "RELEASE_NAME=$(cd addon && mvn help:evaluate -Dexpression=project.name -q -DforceStdout)" >> $GITHUB_ENV | |
echo "RELEASE_VERSION=$(cd addon && mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
echo "RELEASE_ZIP_NAME=$(cd addon && mvn help:evaluate -Dexpression=project.build.finalName -q -DforceStdout).zip" >> $GITHUB_ENV | |
echo "RELEASE_ZIP_PATH=addon/target/$(cd addon && mvn help:evaluate -Dexpression=project.build.finalName -q -DforceStdout).zip" >> $GITHUB_ENV | |
echo "RELEASE_URL_ID=$(cd addon && mvn help:evaluate -Dexpression=project.name -q -DforceStdout| tr -s ' ' | tr ' ' '-' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Build with Maven | |
run: | | |
echo "Building version ${{env.RELEASE_VERSION}} of ${{env.RELEASE_NAME}}" | |
( cd addon && mvn -B install -Pdirectory --file pom.xml ) | |
echo "Package ${{env.RELEASE_ZIP}}" | |
- name: Upload GitHub Assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{env.RELEASE_ZIP_PATH}} | |
asset_name: ${{env.RELEASE_ZIP_NAME}} | |
asset_content_type: application/gzip | |
- name: Upload to Vaadin Directory | |
id: upload | |
uses: wei/curl@v1 | |
continue-on-error: false | |
with: | |
args: -X POST "https://vaadin.com/vaadincom/directory-service/upload/${{env.RELEASE_URL_ID}}" -F "authKey=${{ secrets.DIRECTORY_AUTH_KEY }}" -F "publish=true" -F "releaseNotes=\"${{ github.event.release.body }}\"" -H "accept:\ */*" -H "Content-Type:\ multipart/form-data" -F "file=@${{env.RELEASE_ZIP_PATH}};type=application/zip" | |
- name: Report upload failure | |
if: ${{ job.status == 'failure' }} | |
run: echo '${{ toJSON(job) }}' ; exit 1 |