Skip to content

Commit

Permalink
Merge pull request #2 from joernio/andrei/release-scripts
Browse files Browse the repository at this point in the history
[Workflows] PR and Release scripts
  • Loading branch information
AndreiDreyer committed May 27, 2024
2 parents c50eb25 + d9629bf commit 709139b
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: pr
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- name: Compile and run tests
run: sbt clean test
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- name: Check formatting
run: sbt scalafmtCheck Test/scalafmtCheck
- run: echo "Previous step failed because code is not formatted. Run 'sbt scalafmt Test/scalafmt'"
if: ${{ failure() }}
56 changes: 56 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: release
on:
push:
branches: [master, main]
tags: ["*"]
paths-ignore: ['**.md']
workflow_dispatch: #allows manual trigger

concurrency: production

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Get next release version (dry run)
id: taggerDryRun
uses: anothrNick/github-tag-action@1.61.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DRY_RUN: true
- name: echo new tag
run: |
export NEXT_VERSION=${{ steps.taggerDryRun.outputs.new_tag }}
echo "The next tag version will be: $NEXT_VERSION"
- name: echo tag
run: |
echo "The current tag is: ${{ steps.taggerDryRun.outputs.tag }}"
- name: Compile
run: sbt clean stage
- name: Generate Ruby Types
run: ./joern-benchmarks-datasets ALL
- name: Rename
run: |
mv workspace/ichnaea.zip ichnaea.zip
- name: Set next release version
id: taggerFinal
uses: anothrNick/github-tag-action@1.61.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.taggerDryRun.outputs.new_tag }}
files: |
ichnaea.zip

0 comments on commit 709139b

Please sign in to comment.