diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 5286636..ba584f7 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -4,7 +4,7 @@ on: push: branches: [ dev ] pull_request: - branches: [ dev ] + branches: [ dev, master] schedule: - cron: "30 18 * * *" # run at 00:00 AM IST @@ -19,9 +19,12 @@ jobs: with: repository: tmtsoftware/csw - - uses: olafurpg/setup-scala@v10 + - uses: actions/checkout@v2 + - uses: laughedelic/coursier-setup@v1 with: - java-version: adopt@1.11 + jvm: 11 + apps: sbt sbtn + - uses: coursier/cache-action@v5 - name: Cache ~/.cache uses: actions/cache@v1 @@ -39,28 +42,28 @@ jobs: restore-keys: | ${{ runner.os }}-sbt- - - name: Publish Local - run: sbt clean publishLocal - - - name: Install CS native + - name: Publish Local checked out CSW repo run: | - curl -fLo cs https://git.io/coursier-cli-linux - chmod +x cs - sudo mv cs /usr/local/bin + sbtn clean + sbtn publishLocal - - name: Install giter8 - run: | - cs install giter8 - sudo mv /home/runner/.local/share/coursier/bin/g8 /usr/local/bin - cd /usr/local/bin - chmod +x g8 + - name: Extract branch name (Trigger - PR) + if: github.event_name == 'pull_request' + run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV + + - name: Extract branch name (Trigger - Push) + if: github.event_name != 'pull_request' + shell: bash + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + id: extract_branch - name: Giter8 Compile run: | - echo "Running build for branch ${GITHUB_REF#refs/heads/}" - g8 tmtsoftware/csw.g8 --name=galil --csw_version='0.1.0-SNAPSHOT' --branch ${GITHUB_REF#refs/heads/} + echo "Running build for branch ${BRANCH_NAME}" + g8 tmtsoftware/csw.g8 --name=galil --branch ${BRANCH_NAME} cd galil - sbt clean test + sbtn clean + sbtn test - name: Notify slack if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33ccfa7..8cceda4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,6 @@ on: tags: - "v*" branches: [ master ] - pull_request: - branches: [ master ] jobs: g8: