Skip to content

Commit

Permalink
Add Build JAR action for Copybara (#1)
Browse files Browse the repository at this point in the history
Update bazel test target to //...

Create a GitHub Release with the JAR as an attachment

Remove unnecessary keys from action-gh-release

Use action-automatic-releases instead of action-gh-release

Use short sha in filename of built JAR
  • Loading branch information
alanbato committed May 13, 2021
1 parent 43703eb commit b881dad
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build_jar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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 }}"

0 comments on commit b881dad

Please sign in to comment.