-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
904ebc8
commit 5157e9b
Showing
2 changed files
with
80 additions
and
2 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 |
---|---|---|
@@ -1,35 +1,47 @@ | ||
name: 'Agora Docker build (no push)' | ||
name: 'Agora build and push' | ||
|
||
on: | ||
workflow_dispatch: | ||
merge_group: | ||
pull_request: | ||
|
||
jobs: | ||
build-and-test: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Git secrets setup | ||
run: | | ||
git clone https://github.com/awslabs/git-secrets.git ~/git-secrets | ||
cd ~/git-secrets | ||
git checkout ad82d68ee924906a0401dfd48de5057731a9bc84 | ||
sudo make install | ||
shell: bash | ||
|
||
- name: Secrets check | ||
run: | | ||
sudo ln -s "$(which echo)" /usr/local/bin/say | ||
./minnie-kenny.sh --force | ||
git secrets --scan-history | ||
shell: bash | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
|
||
- name: Bump the tag to a new version | ||
uses: databiosphere/github-actions/actions/[email protected] | ||
id: tag | ||
env: | ||
DEFAULT_BUMP: patch | ||
GITHUB_TOKEN: ${{ secrets.BROADBOT_TOKEN }} | ||
RELEASE_BRANCHES: develop | ||
WITH_V: true | ||
|
||
- name: Build image | ||
run: | | ||
docker build -t agora . |
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,66 @@ | ||
name: Tag | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: "The branch, tag or SHA to checkout" | ||
default: '' | ||
required: false | ||
type: string | ||
dry-run: | ||
description: "Determine the next version without tagging the branch. The workflow can use the outputs new_tag and tag in subsequent steps. Possible values are true and false (default)" | ||
default: false | ||
required: false | ||
type: string | ||
print-tag: | ||
description: "Echo generated tag to console" | ||
default: "true" | ||
required: false | ||
type: string | ||
release-branches: | ||
description: "Default branch (main, develop, etc)" | ||
default: 'main' | ||
required: false | ||
type: string | ||
outputs: | ||
tag: | ||
description: "The value of the latest tag after running this action" | ||
value: ${{ jobs.tag-job.outputs.tag }} | ||
new-tag: | ||
description: "The value of the newly created tag" | ||
value: ${{ jobs.tag-job.outputs.new-tag }} | ||
secrets: | ||
BROADBOT_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
# On tag vs. new-tag. | ||
# The new-tag is always the tag resulting from a bump to the original tag. | ||
# However, the tag is by definition the value of the latest tag after running the action, | ||
# which might not change if dry run is used, and remains same as the original tag. | ||
tag-job: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.tag.outputs.tag }} | ||
new-tag: ${{ steps.tag.outputs.new_tag }} | ||
steps: | ||
- name: Checkout current code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
token: ${{ secrets.BROADBOT_TOKEN }} # this allows the push to succeed later | ||
- name: Bump the tag to a new version | ||
# https://github.com/DataBiosphere/github-actions/tree/master/actions/bumper | ||
uses: databiosphere/github-actions/actions/[email protected] | ||
id: tag | ||
env: | ||
DEFAULT_BUMP: patch | ||
GITHUB_TOKEN: ${{ secrets.BROADBOT_TOKEN }} | ||
DRY_RUN: ${{ inputs.dry-run }} | ||
RELEASE_BRANCHES: ${{ inputs.release-branches }} | ||
WITH_V: true | ||
- name: Echo generated tag to console | ||
if: ${{ inputs.print-tag == 'true' }} | ||
run: | | ||
echo "Newly created version tag: '${{ steps.tag.outputs.new_tag }}'" |