Skip to content
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 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/release.yaml
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

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 prints

Feb 07, 2025 3:52:34 PM com.google.copybara.Main configureLog
INFO: Setting up LogManager
Copybara source mover (Version: Unknown version)

Copy link
Collaborator Author

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:

  protected String getVersion() {
    return "Unknown version";
  }

I have to match to what we do internally.

Copy link
Collaborator Author

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


- 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
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
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
Loading