Skip to content

Release 1.26.0.0

Release 1.26.0.0 #69

Workflow file for this run

name: Build in CI
on:
workflow_dispatch:
push:
paths-ignore:
- '**/.md'
pull_request:
paths-ignore:
- '**/.md'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
name: Build and Test
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Setup Java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: '21'
distribution: adopt
- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92
- name: Build
run: ./gradlew check --info
shell: bash
- name: Release (if required)
id: get-version
if: github.ref == 'refs/heads/main'
run: |-
git config user.name github-actions
git config user.email github-actions@github.com
git remote set-url origin https://x-access-token:$GH_TOKEN@github.com/http4k/standards.git
LOCAL_VERSION=$(jq -r .http4k.version version.json)
git fetch --deepen=1 || true
if git rev-parse HEAD~1 >/dev/null 2>&1; then
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
else
CHANGED_FILES=$(git show --name-only --pretty=format: HEAD)
fi
if [[ "$CHANGED_FILES" != *version.json* ]]; then
echo "Version did not change on this commit. Ignoring"
echo "tag-created=false" >> $GITHUB_OUTPUT
exit 0
fi
git tag -a "$LOCAL_VERSION" -m "Typeflows JVM version $LOCAL_VERSION"
git push origin "$LOCAL_VERSION"
# Output tag for repository dispatch
echo "tag=$LOCAL_VERSION" >> $GITHUB_OUTPUT
echo "tag-created=true" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.TOOLBOX_REPO_TOKEN }}
shell: bash
- name: Repository Dispatch
if: (github.ref == 'refs/heads/main' && steps.get-version.outputs.tag-created == 'true')
run: |-
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{"event_type":"release","client_payload":{"tag":"${{ steps.get-version.outputs.tag }}"}}'
env:
GH_TOKEN: ${{ secrets.TOOLBOX_REPO_TOKEN }}
shell: bash