Skip to content

feat: Release CI/CD #123

feat: Release CI/CD

feat: Release CI/CD #123

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
if: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- run: gradle wrapper --no-daemon
- run: ./gradlew build detekt --no-daemon -Ptargets=linuxX64
build:
runs-on: macos-14
if: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- run: gradle wrapper --no-daemon
- run: ./gradlew build -x check --no-daemon
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: build
release:
runs-on: macos-14
# if: github.ref == 'refs/heads/main'
# needs:
# - test
# - build
env:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_PRIVATE_KEY_B64: ${{ secrets.SIGNING_PRIVATE_KEY_B64 }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- run: echo -n "$SIGNING_PRIVATE_KEY_B64" | base64 --decode | gpg --batch --passphrase $SIGNING_PASSWORD --import
- run: gpg --batch --pinentry-mode=loopback --passphrase $SIGNING_PASSWORD --export-secret-keys > secring.gpg
- run: export SIGNING_SECRET_KEY_RING_FILE=&(realpath secring.gpg)
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build
- run: gradle wrapper --no-daemon
- run: ./gradlew publishAllPublicationsToSonatypeRepository -x check --no-daemon
- name: Create release
env:
tag: ${{ github.ref_name }}
run: |
export tag=$(cat version.txt)
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} $tag" \
--generate-notes