Skip to content

fix:disable deployment of examples. (#60) #34

fix:disable deployment of examples. (#60)

fix:disable deployment of examples. (#60) #34

Workflow file for this run

# 相当于脚本用途的一个声明
name: Snapshot
# 触发脚本的事件 这里为发布release之后触发
on:
push:
branches:
- main
- dubbo-3.2.x
jobs:
check-snapshot:
runs-on: ubuntu-latest
outputs:
IS_SNAPSHOT: ${{ steps.set_output_1.outputs.IS_SNAPSHOT }}
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Check deploy type
id: set_output_1
run: |
line="$(grep SNAPSHOT pom.xml || true)"
echo $line
if [ -n "$line" ]; then
echo "IS_SNAPSHOT=true" >> $GITHUB_OUTPUT
else
echo "IS_SNAPSHOT=false" >> $GITHUB_OUTPUT
fi
release:
runs-on: ubuntu-latest
needs: check-snapshot
if: ${{ needs.check-snapshot.outputs.IS_SNAPSHOT == 'true' }}
steps:
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn --batch-mode clean deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}