Skip to content

*fix workflows

*fix workflows #1

name: Publish new version
on:
push:
branches:
- 'master'
jobs:
build_project:
runs-on: macos-latest
env:
GITHUB_USER: ${{ secrets.USER }}
GITHUB_API_KEY: ${{ secrets.PAT }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-tags: true
fetch-depth: 0
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set version
run: |
VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
major=$(echo $VERSION | cut -d'.' -f1)
minor=$(echo $VERSION | cut -d'.' -f2)
fix=$(echo $VERSION | cut -d'.' -f3)
echo "LIBRARY_VERSION=$major.$minor.$(($fix + 1))" >> "$GITHUB_ENV"
- name: Build and publish
run: |
echo ${{ env.LIBRARY_VERSION }}
- name: Build and publish
run: |
./gradlew buildAndPublish --no-daemon
- name: Create tag
uses: actions/github-script@v7.0.1
with:
github-token: ${{ env.GITHUB_API_KEY }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ env.LIBRARY_VERSION }}',
sha: context.sha
})