-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create weekly test releases #310
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,75 @@ | ||
name: Weekly Release | ||
|
||
on: | ||
# Uncoment these two lines to test the pipeline in a PR, but NEVER merge in main branch: | ||
# pull_request: | ||
# branches: [ "master" ] | ||
schedule: | ||
- cron: '0 11 * * 1' # Run every Monday at 7am NYC time | ||
branches: | ||
- master | ||
workflow_dispatch: # allows manual releasing | ||
branches: | ||
- master | ||
jobs: | ||
build_and_release: | ||
runs-on: ubuntu-latest | ||
# Uncomment for testing in PRs, but NEVER merge in main branch: | ||
#if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Bazel | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '21' | ||
|
||
- name: Build with Bazel | ||
run: bazel build java/com/google/copybara/copybara_deploy.jar | ||
|
||
- name: Get current date | ||
id: date | ||
run: | | ||
echo "date=$(date +%Y%m%d)" >> $GITHUB_ENV | ||
|
||
- name: Calculate SHA256 checksum | ||
id: checksum | ||
run: sha256sum bazel-bin/java/com/google/copybara/copybara_deploy.jar | awk '{print $1}' > copybara_deploy.jar.sha256 | ||
|
||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.date.outputs.date }} | ||
release_name: Release v${{ env.date }} | ||
body: | | ||
Automated weekly test release snapshot from master branch. | ||
This is a test release, version compatibility or correctness | ||
mikelalcon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
not guaranteed. | ||
draft: false # change this to true when testing | ||
|
||
- name: Upload Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: bazel-bin/java/com/google/copybara/copybara_deploy.jar | ||
asset_name: copybara_deploy.jar | ||
mikelalcon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
asset_content_type: application/java-archive | ||
|
||
- name: Upload Checksum File | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: copybara_deploy.jar.sha256 | ||
asset_name: copybara_deploy.jar.sha256 | ||
asset_content_type: text/plain |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs
--stamp
or--embed_label
here, since today's new release printsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to look at this, our current oss implementation does this:
I have to match to what we do internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just merged eee4901 for this