3.2.3 #19
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: Maven Package | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mariadb: | |
image: mariadb:10.5 | |
env: | |
MYSQL_DB: pth_06 | |
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Initialize MariaDB | |
env: | |
MARIADB_PORT: ${{ job.services.mariadb.ports[3306] }} | |
run: | | |
echo "Creating databases" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} <<< "CREATE DATABASE streamdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} <<< "CREATE DATABASE journaldb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} <<< "CREATE DATABASE bloomdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
echo "Creating users" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} <<< "grant all privileges on streamdb.* to streamdb@'%' identified by 'streamdb_pass';" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} <<< "grant all privileges on journaldb.* to streamdb@'%' identified by 'streamdb_pass';" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} <<< "grant all privileges on bloomdb.* to streamdb@'%' identified by 'streamdb_pass';" | |
echo "Importing journaldb" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} -D journaldb < database/journaldb.sql | |
echo "Importing streamdb" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} -D streamdb < database/streamdb.sql | |
echo "Importing bloomdb" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} -D bloomdb < database/bloomdb.sql | |
echo "Flushing privileges" | |
mysql -u root -h127.0.0.1 -P${MARIADB_PORT} <<< "flush privileges;" | |
- name: Setup Signing | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8.0.292+10 | |
distribution: 'adopt' | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Setup GitHub Packages | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8.0.292+10 | |
distribution: 'adopt' | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Generate sources | |
run: mvn -B -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= generate-sources | |
env: | |
MARIADB_PORT: ${{ job.services.mariadb.ports[3306] }} | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Inject licenses to generated files | |
run: bash add_headers_to_generated.sh | |
- name: Publish to GitHub Packages Apache Maven | |
run: mvn -Pbuild-nogenerate,publish-github-packages -B -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Setup Maven Central | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8.0.292+10 | |
distribution: 'adopt' | |
server-id: central-sonatype-org | |
server-username: CENTRAL_SONATYPE_ORG_USERNAME | |
server-password: CENTRAL_SONATYPE_ORG_PASSWORD | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Publish to Maven Central | |
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Pbuild-nogenerate,publish-maven-central | |
env: | |
CENTRAL_SONATYPE_ORG_USERNAME: ${{ secrets.CENTRAL_SONATYPE_ORG_USERNAME }} | |
CENTRAL_SONATYPE_ORG_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_ORG_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |