forked from google/copybara
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.5 KB
/
build_jar.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
46
name: "Build JAR"
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Tag to create and release.'
required: true
default: 'latest'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '8'
- name: Setup Bazelisk
uses: bazelbuild/[email protected]
- name: Mount bazel cache # Optional
uses: actions/cache@v1
with:
path: "~/.cache/bazel"
key: bazel
- name: Build Copybara
run: "bazel build //java/com/google/copybara:copybara_deploy.jar"
- name: Test Copybara
run: "bazel test //..."
- name: Rename JAR
run: "mv bazel-bin/java/com/google/copybara/copybara_deploy.jar copybara-${{ github.event.inputs.release_tag }}.jar"
- name: Store built JAR
uses: actions/upload-artifact@v2
with:
name: "copybara-${{ github.event.inputs.release_tag }}.jar"
path: "copybara-${{ github.event.inputs.release_tag }}.jar"
if-no-files-found: error
- name: Automatic Releases
uses: marvinpinto/[email protected]
with:
automatic_release_tag: "release-${{ github.event.inputs.release_tag }}"
prerelease: false
files: "copybara-${{ github.event.inputs.release_tag }}.jar"
repo_token: "${{ secrets.GITHUB_TOKEN }}"