feat: 🚀 upgrade gherkin support (#1) #6
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 and Deploy | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
status: ${{ steps.check.outputs.status }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: changes | |
uses: dorny/paths-filter@v2 | |
with: | |
filters: | | |
production: | |
- 'src/**' | |
- 'pom.xml' | |
- id: check | |
name: Check production files changes | |
run: | | |
status="skip" | |
if [ "${{ steps.changes.outputs.production }}" == "true" ]; then | |
status="deploy" | |
fi | |
echo "status=$status" >> $GITHUB_OUTPUT | |
publish: | |
runs-on: ubuntu-latest | |
needs: check | |
if: "needs.check.outputs.status == 'deploy' && !contains(github.event.head_commit.message, 'ci skip')" | |
steps: | |
- uses: actions/checkout@v3 | |
# with: | |
# ssh-key: ${{ secrets.ACTION_BOT_SECRET_KEY }} | |
- name: Set up java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: adopt | |
cache: maven | |
server-id: ossrh | |
server-username: OSS_SONATYPE_USERNAME | |
server-password: OSS_SONATYPE_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Create maven release version | |
if: ${{ github.event_name == 'push' }} | |
run: mvn -f pom.xml -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion} versions:commit | |
- name: Deploy | |
run: mvn --batch-mode --update-snapshots deploy -P release | |
env: | |
OSS_SONATYPE_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} | |
OSS_SONATYPE_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: my-artifact | |
path: | | |
target/asciidoctor-gherkin-extension-*.jar | |
target/asciidoctor-gherkin-extension-*.pom | |
retention-days: 1 | |
- name: Create and commit next dev version | |
if: ${{ github.event_name == 'push' }} | |
run: mvn -f pom.xml -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}-SNAPSHOT versions:commit | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Post release - ci skip |