forked from joernio/joern
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (105 loc) · 3.76 KB
/
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: release
on:
schedule:
- cron: "0 7 * * *" # run once daily
workflow_dispatch: # allow to manually trigger this workflow
jobs:
release:
if: github.repository_owner == 'joernio'
concurrency: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '19'
- run: sudo apt update && sudo apt install -y gnupg
- run: echo $PGP_SECRET | base64 --decode | gpg --batch --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install Bundler
run: gem install bundler -v 2.4.22
- name: Delete `.rustup` directory
run: rm -rf /home/runner/.rustup # to save disk space
if: runner.os == 'Linux'
- name: Delete `.cargo` directory # to save disk space
run: rm -rf /home/runner/.cargo
if: runner.os == 'Linux'
- run: sbt scalafmtCheck +test
- run: ./testDistro.sh
- run: |
cd joern-cli/target/universal/stage
./schema-extender/test.sh
cd -
- run: sbt ciReleaseTagNextVersion ciReleaseSonatype createDistribution
env:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- run: sha512sum target/joern-cli.zip > target/joern-cli.zip.sha512
- name: Export ENV vars
run:
echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- run: sbt "querydb/runMain io.joern.dumpq.Main"
- 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
- name: Upload joern-install.sh
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./joern-install.sh
asset_name: joern-install.sh
asset_content_type: text/plain
- name: Upload joern-cli.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/joern-cli.zip
asset_name: joern-cli.zip
asset_content_type: application/zip
- name: Upload joern-cli.zip.sha512
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/joern-cli.zip.sha512
asset_name: joern-cli.zip.sha512
asset_content_type: text/plain
- name: Upload querydb.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: querydb/target/querydb.zip
asset_name: querydb.zip
asset_content_type: application/zip
- name: Upload querydb.json
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/querydb.json
asset_name: querydb.json
asset_content_type: application/json