forked from ShiftLeftSecurity/codepropertygraph
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (71 loc) · 2.39 KB
/
gh_release.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: gh packages release
on:
push:
branches: [ master ]
workflow_dispatch: # allow to manually trigger this workflow
jobs:
test-codepropertygraph:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- name: Clone submodules
run: git submodule update --init --recursive
- name: apt-get update
run: sudo apt-get update
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 19
- name: Check formatting
run: sbt scalafmtCheck Test/scalafmtCheck
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "Previous step failed because code is not formatted. Run 'sbt scalafmt'"
if: ${{ failure() }}
- name: Check domain classes
run: sbt generateDomainClassesCheck
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "Previous step failed because latest domain classes are not committed. Run 'sbt generateDomainClasses' (should be triggered automatically by `sbt compile`, so maybe you just forgot to commit?)"
if: ${{ failure() }}
- name: Compile and run tests
run: sbt +test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
concurrency: release
needs: [test-codepropertygraph]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- name: Clone submodules
run: git submodule update --init --recursive
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 19
- name: Release to GH Packages
run: sbt ciReleaseTagNextVersion publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Export ENV vars
run:
echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.LATEST_TAG }}
release_name: ${{ env.LATEST_TAG }}
draft: false
prerelease: false