Skip to content

Commit cc042fc

Browse files
author
Merlin Rabens
authored
Update release.yml
1 parent 25ce543 commit cc042fc

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,42 @@ name: Release
22

33
on:
44
push:
5-
tags: ["*"]
6-
workflow_dispatch:
7-
branches:
8-
- master
9-
5+
branches:
6+
- $default-branch
7+
tags:
8+
- 'v*'
9+
1010
jobs:
11-
publish:
11+
build:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
- uses: olafurpg/setup-scala@v2
16-
- name: Publish
15+
with:
16+
# We need to unshallow to allow git describe work with last tag
17+
fetch-depth: 0
18+
- uses: actions/setup-java@v1
19+
with:
20+
java-version: 8
21+
- uses: coursier/cache-action@v5
22+
- id: test
23+
name: Test
24+
env:
25+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
26+
run: sbt test
27+
- id: publish-sonatype
28+
name: Publish Sonatype
1729
env:
30+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
1831
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
1932
PGP_SECRET: ${{ secrets.PGP_SECRET }}
2033
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
2134
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2235
run: sbt ci-release
36+
- name: Send slack notification
37+
uses: act10ns/slack@v1
38+
env:
39+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
40+
with:
41+
status: ${{ job.status }}
42+
steps: ${{ toJson(steps) }}
43+
if: failure() && env.SLACK_WEBHOOK_URL

0 commit comments

Comments
 (0)