Skip to content

Merge pull request #7 from RobinPcrd/icon-toggle-button #41

Merge pull request #7 from RobinPcrd/icon-toggle-button

Merge pull request #7 from RobinPcrd/icon-toggle-button #41

Workflow file for this run

name: Build, Publish, and Release
on:
push:
branches:
- main
workflow_dispatch:
jobs:
infer-release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
released: ${{ steps.get_version.outputs.released }}
# version: ${{ steps.nyx.outputs.version }}
steps:
- name: "✅ Checkout code"
uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: "⚙️ Setup Node.js"
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: 'npm'
- name: "📦 Install semantic-release"
run: npm ci
# npm install -g semantic-release
# npm install -g @semantic-release/release-notes-generator
# npm install -g @semantic-release/commit-analyzer
# npm install -g @semantic-release/github
# npm install -g conventional-changelog-conventionalcommits
# npm install -g @semantic-release/changelog
# npm install -g @semantic-release/git
- name: "🚀 Run semantic-release"
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
- name: "🔍 Get released version"
id: get_version
run: |
if [ -f .semantic-release-version ]; then
VERSION=$(cat .semantic-release-version)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "released=true" >> $GITHUB_OUTPUT
echo "✅ Released version: $VERSION"
else
echo "version=" >> $GITHUB_OUTPUT
echo "released=false" >> $GITHUB_OUTPUT
echo "❌ No release created"
fi
build-and-publish:
runs-on: macos-latest
needs: infer-release
if: needs.infer-release.outputs.released == 'true'
steps:
- name: "✅ Checkout code"
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: "⚙️ Set up JDK 21"
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: "⚙️ Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 9.0.0
- name: "🌎 Publish with Gradle"
run: ./gradlew publish --no-configuration-cache -Pversion=$VERSION --build-cache --daemon --parallel --scan
env:
VERSION: ${{ needs.infer-release.outputs.version }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}