upstream-build #942
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: Build component | |
on: | |
push: | |
pull_request: | |
repository_dispatch: | |
types: [upstream-build, manual-build] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources from component repository | |
uses: actions/checkout@v4 | |
- name: Checkout additional sources from product repository | |
uses: actions/checkout@v4 | |
with: | |
repository: Guite/MostProduct | |
token: ${{ secrets.ACCESS_MOST_PRODUCT }} | |
path: MostProduct | |
# see https://github.com/actions/setup-java | |
- name: Setup JDK | |
uses: actions/setup-java@master | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
cache: 'maven' | |
# https://stackoverflow.com/questions/71069/can-maven-be-made-less-verbose | |
- name: Maven Build | |
run: | | |
mvn verify -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn | |
- name: Collect artifacts to deploy | |
run: | | |
mkdir -p deploy/repo | |
cp -R releng/org.zikula.modulestudio.generator.build/target/repository/* deploy/repo | |
# see https://github.com/WebFreak001/deploy-nightly | |
- name: Deploy standalone generator | |
uses: WebFreak001/deploy-nightly@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: https://uploads.github.com/repos/Guite/MostGenerator/releases/22066470/assets{?name,label} | |
release_id: 22066470 | |
asset_path: ./bundles/org.zikula.modulestudio.generator/target/ModuleStudio-generator.jar | |
#asset_name: ModuleStudio-generator-$$.jar # $$ inserts date (YYYYMMDD) and 6 letter commit hash, example: https://github.com/Pure-D/serve-d/releases/tag/nightly | |
asset_name: ModuleStudio-generator.jar | |
asset_content_type: application/java-archive | |
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted | |
- name: Regenerate modules | |
run: ./.github/scripts/regenerateModules.sh | |
env: | |
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }} | |
# see https://github.com/SamKirkland/FTP-Deploy-Action | |
- name: Deploy repository | |
uses: SamKirkland/FTP-Deploy-Action@master | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: deploy/repo/ | |
server-dir: components/generator/ | |
dangerous-clean-slate: true | |
# see https://github.com/peter-evans/repository-dispatch | |
- name: Dispatch downstream job | |
uses: peter-evans/repository-dispatch@main | |
with: | |
token: ${{ secrets.DISPATCH_TOKEN }} | |
repository: Guite/MostProduct | |
event-type: upstream-build |