Skip to content

Deployment workflow #62

Deployment workflow

Deployment workflow #62

Workflow file for this run

name: Deployment workflow
on:
workflow_dispatch:
inputs:
release_version:
description: 'Semantic version number to release'
required: true
spotify_test_client_token:
description: 'Spotify client redirect token (for client tests before release)'
required: true
spotify_test_redirect_uri:
description: 'Spotify redirect uri'
required: true
env:
SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }}
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
# TODO temporarily deactivating client tests due to flaky (from spotify responses) tests
#SPOTIFY_TOKEN_STRING: ${{ github.event.inputs.spotify_test_client_token }}
SPOTIFY_REDIRECT_URI: ${{ github.event.inputs.spotify_test_redirect_uri }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SPOTIFY_API_PUBLISH_VERSION: ${{ github.event.inputs.release_version }}
jobs:
release_android_jvm_linux_js:
runs-on: ubuntu-latest
environment: release
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Install java 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Install curl
run: sudo apt-get install -y curl libcurl4-openssl-dev
- name: Verify Android
run: ./gradlew testDebugUnitTest
- name: Verify JVM/JS
run: ./gradlew jvmTest
- name: Publish JVM/Linux/Android
run: ./gradlew publishKotlinMultiplatformPublicationToNexusRepository publishJvmPublicationToNexusRepository publishAndroidPublicationToNexusRepository publishLinuxX64PublicationToNexusRepository publishJsPublicationToNexusRepository
- name: Archive test results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: build/reports
if: always()
release_mac:
runs-on: macos-latest
environment: release
needs: release_android_jvm_linux_js
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Install java 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Publish macOS/iOS
run: ./gradlew publishMacosX64PublicationToNexusRepository publishIosX64PublicationToNexusRepository publishIosArm64PublicationToNexusRepository
release_windows:
runs-on: windows-latest
environment: release
needs: release_android_jvm_linux_js
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Install java 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- run: choco install curl
- name: Publish windows
run: ./gradlew publishMingwX64PublicationToNexusRepository
release_docs:
runs-on: ubuntu-latest
environment: release
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Install java 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Build docs
run: ./gradlew dokkaHtml
- name: Push docs to docs repo
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'docs'
destination-github-username: 'adamint'
destination-repository-name: 'spotify-web-api-kotlin-docs'
user-email: [email protected]
target-branch: main