Skip to content

Commit 14f6c28

Browse files
committed
Create test weekly releases
Fixes #275 Change-Id: Id7c7716d0b4dcc3f75d872d9945fd43d056df1ca
1 parent f653206 commit 14f6c28

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

Diff for: .github/workflows/release.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Weekly Release
2+
3+
on:
4+
schedule:
5+
- cron: '0 11 * * 1' # Run every Monday at 7am NYC time
6+
branches:
7+
- master
8+
workflow_dispatch: # allows manual releasing
9+
branches:
10+
- master
11+
jobs:
12+
build_and_release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Bazel
19+
uses: actions/setup-java@v3
20+
with:
21+
distribution: 'adopt'
22+
java-version: '21'
23+
24+
- name: Build with Bazel
25+
run: bazel build java/com/google/copybara/copybara_deploy.jar
26+
27+
- name: Get current date
28+
id: date
29+
run: echo "::set-output name=date::$(date +%Y%m%d)"
30+
31+
- name: Create Release
32+
uses: actions/create-release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tag_name: v${{ steps.date.outputs.date }}
37+
release_name: Release v${{ steps.date.outputs.date }}
38+
body: |
39+
Automated weekly test release snapshot from master branch.
40+
This is a test release, version compatibility or correctness
41+
not guaranteed.
42+
draft: true # change this to false once it works
43+
44+
- name: Upload Release Asset
45+
uses: actions/upload-release-asset@v1.0.2
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
asset_path: bazel-bin/java/com/google/copybara/copybara_deploy.jar
51+
asset_name: copybara_deploy.jar
52+
asset_content_type: application/java-archive

0 commit comments

Comments
 (0)