Error handling in passes (#142) #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: gh packages release | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: # allow to manually trigger this workflow | |
jobs: | |
release: | |
if: github.repository_owner == 'Privado-Inc' | |
concurrency: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- 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 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - run: export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} && ./testDistro.sh | |
- run: | | |
sbt stage | |
cd joern-cli/target/universal/stage | |
./schema-extender/test.sh | |
cd - | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: sbt createDistribution | |
run: | | |
sbt createDistribution | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: sbt ciReleaseTagNextVersion publish | |
run: | | |
sbt ciReleaseTagNextVersion publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- 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" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- 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 |