forked from google/copybara
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Build JAR action for Copybara (#1)
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
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" | ||
|