Skip to content

Commit

Permalink
Replace version.sbt with sbt-dynver for the new release process (#447)
Browse files Browse the repository at this point in the history
* Replace version.sbt with sbt-dynver for the new release process

* rm releaseCrossBuild
  • Loading branch information
vilunov authored Sep 25, 2024
1 parent 18680f3 commit c57387a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
56 changes: 49 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,53 @@
name: Publish new Release
name: Test and publish a new release

on:
release:
types: [published]
branches: [master]
push:
tags:
- 'v*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
SBT_CREDENTIALS: '.credentials'

jobs:
release:
uses: evolution-gaming/scala-github-actions/.github/workflows/release.yml@v1
secrets: inherit
publish-release:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: coursier/cache-action@v6

- name: setup Java and SBT
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'oracle'
cache: 'sbt'

- name: setup credentials
run: |
echo "realm=Artifactory Realm" >> ${{ env.SBT_CREDENTIALS }}
echo "host=evolution.jfrog.io" >> ${{ env.SBT_CREDENTIALS }}
echo "user=github-publish" >> ${{ env.SBT_CREDENTIALS }}
echo "password=${{secrets.JFROG_ACCESS_TOKEN}}" >> ${{ env.SBT_CREDENTIALS }}
- name: check, test and package
run: sbt "clean; versionPolicyCheck; +all test package"

- name: publish on JFrog Artifactory
run: sbt "+publish"

- name: cleanup credentials
if: always()
run: rm -rf ${{ env.SBT_CREDENTIALS }}

- name: delete tag
if: failure()
run: git push --delete origin ${{ github.ref_name }}
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ lazy val commonSettings = Seq(
scalaVersion := crossScalaVersions.value.head,
crossScalaVersions := Seq("2.13.12", "3.3.1", "2.12.18"),
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))),
releaseCrossBuild := true,
Compile / doc / scalacOptions += "-no-link-warnings",
scalacOptions ++= crossSettings(
scalaVersion.value,
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11")

addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")

addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9")

Expand Down
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.

0 comments on commit c57387a

Please sign in to comment.