Skip to content

switch-publish

switch-publish #2

Workflow file for this run

name: switch-publish
on:
workflow_dispatch:
jobs:
publish:
if: ${{ github.repository == 't895/Switch' }}
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Give execution permissions to the gradle wrapper
run: chmod +x ./gradlew
- name: Create secrets file
run: |
echo "${{secrets.SIGNING_SECRET_KEYRING_BASE64}}" | base64 --decode > ${HOME}/keyring.asc
gpg --output ${HOME}/keyring.asc.gpg --dearmor ${HOME}/keyring.asc
- name: Set up environment
run: |
echo "mavenCentralUsername=${{secrets.MAVEN_USERNAME}}" >> gradle.properties
echo "mavenCentralPassword=${{secrets.MAVEN_PASSWORD}}" >> gradle.properties
echo "signing.keyId=${{secrets.SIGNING_KEY_ID}}" >> gradle.properties
echo "signing.password=${{secrets.SIGNING_PASSWORD}}" >> gradle.properties
echo "signing.secretKeyRingFile=${HOME}/keyring.asc.gpg" >> gradle.properties
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build and publish
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache