-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (38 loc) · 1.3 KB
/
release.yaml
File metadata and controls
42 lines (38 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Publish to GitHub Maven Repository
on: workflow_dispatch
jobs:
release:
name: SBT Release
runs-on: ubuntu-latest
permissions:
id-token: write
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v5
if: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags') && always() }}
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v4
if: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) && always() }}
with:
fetch-depth: 0
- name: Setup Scala
uses: japgolly/setup-everything-scala@v3.1
with:
java-version: temurin:1.23.0.1
- name: Prepare release command
shell: bash
run:
releaseVersion=$(git describe --tags --abbrev=7)
rvn="${releaseVersion:1}"
commandText="release release-version $rvn next-version $rvn-SNAPSHOT"
echo "command=$commandText" >> "$GITHUB_OUTPUT"
id: release_command
- name: Release new version
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.MAVEN_PUBLISH_TOKEN }}
run: |
sbt '${{ steps.release_command.outputs.command }}'