Skip to content

Publish

Publish #3

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v0.5.*'
workflow_dispatch:
schedule:
# Snapshot release every second work day
- cron: '0 0 * * 1,3,5'
jobs:
check-compiles:
name: Test compilation of all modules
runs-on: ubuntu-22.04
if: github.repository == 'scala-native/scala-native'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: "2.13" #Unused, any version can be placed here
java-version: 8
- name: Compile everything
run: sbt "-v" "-J-Xmx7G" "++3.3.0; Test/compile; ++2.13.11; Test/compile; ++2.12.18; Test/compile"
publish:
name: Publish for each Scala binary version
runs-on: ubuntu-22.04
needs: [check-compiles]
if: github.repository == 'scala-native/scala-native'
strategy:
fail-fast: false
matrix:
scala: ["2.12", "2.13", "3"]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{ matrix.scala }} #Unused, any version can be placed here
java-version: 8
- name: Setup PGP Key
run: |
echo -n "$PGP_SECRET" | base64 --decode | gpg --batch --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Publish release
env:
MAVEN_USER: "${{ secrets.SONATYPE_USER }}"
MAVEN_PASSWORD: "${{ secrets.SONATYPE_PASSWORD }}"
PGP_PASSPHRASE: "${{ secrets.PGP_PASSWORD }}"
run: sbt "-v" "-J-Xmx7G" "-J-XX:+UseG1GC" "publish-release-for-version ${{ matrix.scala }}"
dispatch:
name: Dispatch trigger builds for dependant projects
runs-on: ubuntu-latest
needs: [publish]
if: github.event_name == 'schedule' && github.repository == 'scala-native/scala-native'
strategy:
matrix:
repo: ['scala-native/scala-native-cli']
timeout-minutes: 5
steps:
- name: Dispatch to workflows of dependant projects
run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" \
--request POST \
--data '{"event_type": "nightly-published", "client_payload": {} }' \
https://api.github.com/repos/${{ matrix.repo }}/dispatches