Skip to content

More updates (#7)

More updates (#7) #10

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
tags:
- '*--*'
jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4.0.2
- uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-version: 1.19.0
- run: cat .bazelrc.ci >> .bazelrc
- run: ./scripts/format.sh check
- run: ./test/run_all_tests.sh ci
publish:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: build-and-test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4.0.2
- uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-version: 1.19.0
- run: cat .bazelrc.ci >> .bazelrc
- name: Parse Tag
run: |
# Tag should be <artifact_id suffix>--<version>
tag=$(awk -F '/' '{print $NF}' <<< $GITHUB_REF)
artifact_id=twirl-compiler-cli_$(awk -F '--' '{print $1}' <<< $tag)
version=$(awk -F '--' '{print $2}' <<< $tag)
echo "COMPILER_CLI_ARTIFACT_ID=$artifact_id" >> $GITHUB_ENV
echo "COMPILER_CLI_VERSION=$version" >> $GITHUB_ENV
- name: Import gpg keys
run: echo "$PGP_SECRET" | base64 --decode | gpg --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Publish to Maven
run: ./scripts/publish.sh
env:
DEPLOY_MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
DEPLOY_MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}