v4.2.0 #10
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: Upload Release Assets | |
on: | |
release: | |
types: [ prereleased, released ] | |
workflow_dispatch: | |
jobs: | |
upload-release-assets: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: get_version | |
uses: battila7/get-version-action@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
- name: Generate CLI jar | |
if: github.event_name == 'release' | |
run: ./gradlew shadowJar | |
- name: Upload JAR Asset | |
if: github.event_name == 'release' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./cli/build/libs/gtfs-validator-${{ steps.get_version.outputs.version-without-v }}-cli.jar | |
asset_name: gtfs-validator-${{ steps.get_version.outputs.version-without-v }}-cli.jar | |
asset_content_type: application/java-archive | |
- name: Generate rules.json | |
if: github.event_name == 'release' | |
run: ./gradlew webClientRulesJSON | |
- name: Upload rules.json asset | |
if: github.event_name == 'release' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./web/client/static/rules.json | |
asset_name: rules.json | |
asset_content_type: application/json | |
- name: Generate JavaDocs | |
if: github.event_name == 'release' | |
run: ./gradlew aggregateJavadoc | |
- name: Zip JavaDocs | |
if: github.event_name == 'release' | |
run: zip -r javadocs.zip build/docs/aggregateJavadoc | |
- name: Upload zipped Javadocs | |
if: github.event_name == 'release' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./javadocs.zip | |
asset_name: javadocs.zip | |
asset_content_type: application/zip | |
# The following steps will publish artifacts to a sonatype staging repo with the aim of promoting them to maven central | |
# Pretty much everything is done through gradle. | |
# The version used will be according to the axion-release-plugin, meaning it will take a tag if present. | |
# The tag should follow semantic versioning, e.g. v1.2.3. There could be a suffix, e.g. v1.2.3-TEST | |
# gradle will build, sign then upload artifacts to a Sonatype staging repo. | |
# See https://s01.oss.sonatype.org for accessing these repos. | |
# At this point it should manually be closed, which will trigger acceptance tests for maven central (but not transfer yet) | |
# Once closed, the repo is available for testing. | |
# After testing, it can be manually promoted on the sonatype site, which will then publish to maven central. | |
# Note than once in maven central a release cannot be removed or altered. | |
- name: Load secrets from 1Password | |
id: onepw_secrets | |
uses: 1password/load-secrets-action@v1.3.1 | |
with: | |
export-env: true # Export loaded secrets as environment variables | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} # This is required to connect to the vault in our 1Password account. | |
MAVEN_GPG_PRIVATE_KEY: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/yztcx47yzp4vizjyaq7ulvkgoi/Private Key" | |
MAVEN_GPG_PASSPHRASE: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/yztcx47yzp4vizjyaq7ulvkgoi/password" | |
- name: Build and Publish to Sonatype | |
run: | | |
# The gradle java verifying plugin does not work with java 17. | |
# Don't verify since it has already been done when the PR was created. | |
./gradlew publish -x verifyGoogleJavaFormat | |
env: | |
SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}} | |
SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}} |