-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (43 loc) · 1.42 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches:
- master
tags:
- '*--*'
jobs:
build-and-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm install -g @bazel/bazelisk
- run: cat .bazelrc.ci >> .bazelrc
- 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-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm install -g @bazel/bazelisk
- 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=play-routes-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 }}