Skip to content

bumper tbd-libs

bumper tbd-libs #269

Workflow file for this run

name: build and publish
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21.x'
- name: test and build
uses: gradle/actions/setup-gradle@v3
with:
arguments: build
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'ci skip')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set release tag
run: |
export TAG_NAME="$(TZ="Europe/Oslo" date +%Y%m%d%H%M%s).$(echo $GITHUB_SHA | cut -c 1-12)"
echo "RELEASE_TAG=$TAG_NAME" >> $GITHUB_ENV
- uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # ratchet:ncipollo/release-action@v1
with:
tag: ${{ env.RELEASE_TAG }}
generateReleaseNotes: true
outputs:
tag: ${{ env.RELEASE_TAG }}
publish:
runs-on: ubuntu-latest
needs: release
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21.x'
- name: publish
uses: gradle/actions/setup-gradle@v3
with:
arguments: -Pversion=${{ needs.release.outputs.tag }} publish
env:
ORG_GRADLE_PROJECT_githubUser: x-access-token
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}