Skip to content

[publish] Merge pull request #364 from Polar-Pumpkin/patch-1 #34

[publish] Merge pull request #364 from Polar-Pumpkin/patch-1

[publish] Merge pull request #364 from Polar-Pumpkin/patch-1 #34

name: build
on:
push:
branches:
- master
jobs:
build:
if: "contains(github.event.head_commit.message, 'publish')"
runs-on: ubuntu-latest
steps:
# 环境配置
- name: checkout repository
uses: actions/checkout@v2
- name: cache gradle packages
uses: actions/cache@v2
with:
key: ${{ runner.os }}-build-${{ env.cache-name }}
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk 8.0
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 8.0
# 设置权限
- name: make gradle wrapper executable
run: chmod +x ./gradlew
# 发布到仓库
- name: publish
id: publish_1
continue-on-error: true
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish -Pbuild=$GITHUB_RUN_NUMBER -PtaboolibUsername=$NEXUS_USERNAME -PtaboolibPassword=$NEXUS_PASSWORD
# 发布到仓库: 重试-1
- name: publish (retry 1)
id: publish_2
if: steps.publish_1.outcome == 'failure'
continue-on-error: true
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish -Pbuild=$GITHUB_RUN_NUMBER -PtaboolibUsername=$NEXUS_USERNAME -PtaboolibPassword=$NEXUS_PASSWORD
# 发布到仓库: 重试-2
- name: publish (retry 2)
id: publish_3
if: steps.publish_2.outcome == 'failure'
continue-on-error: true
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish -Pbuild=$GITHUB_RUN_NUMBER -PtaboolibUsername=$NEXUS_USERNAME -PtaboolibPassword=$NEXUS_PASSWORD
# 发布到仓库: 重试-3
- name: publish (retry 3)
id: publish_4
if: steps.publish_3.outcome == 'failure'
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish -Pbuild=$GITHUB_RUN_NUMBER -PtaboolibUsername=$NEXUS_USERNAME -PtaboolibPassword=$NEXUS_PASSWORD
# 发布到 GitHub
- name: create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 6.0.12-${{ github.run_number }}
release_name: Release 6.0.12-${{ github.run_number }}