Skip to content

Commit 0dcb3c1

Browse files
committed
added release action
1 parent 4ef0341 commit 0dcb3c1

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: Release version
8+
required: false
9+
default: ''
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out repository code
17+
uses: actions/checkout@v2
18+
with:
19+
token: ${{ secrets.GIT_TOKEN }}
20+
- name: Setup JDK
21+
uses: actions/setup-java@v2
22+
with:
23+
distribution: 'temurin'
24+
java-version: '11'
25+
- name: Configure local git
26+
run: |
27+
git config user.name "${{ secrets.GIT_USERNAME }}"
28+
git config user.email "${{ secrets.GIT_USER_EMAIL }}"
29+
- name: Release new version
30+
if: ${{ github.event.inputs.release_version == '' }}
31+
run: |
32+
sbt "release with-defaults"
33+
- name: Release the specified version
34+
if: ${{ github.event.inputs.release_version != '' }}
35+
env:
36+
run: |
37+
sbt "release with-defaults release-version ${{ github.event.inputs.release_version }}"
38+
- name: Build
39+
run: sbt assembly
40+
- name: Release
41+
uses: softprops/action-gh-release@v1
42+
if: startsWith(github.ref, 'refs/tags/')
43+
with:
44+
files: |
45+
target/scala-3.1.2/polystat.jar

build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ releaseProcess := Seq[ReleaseStep](
4545
runClean,
4646
runTest,
4747
setReleaseVersion,
48-
// commitReleaseVersion,
49-
// tagRelease,
48+
commitReleaseVersion,
49+
tagRelease,
5050
setNextVersion,
51-
// commitNextVersion,
52-
// pushChanges,
51+
commitNextVersion,
52+
pushChanges,
5353
)
5454

5555
val githubWorkflowScalas = List("3.1.2")

0 commit comments

Comments
 (0)