-
Notifications
You must be signed in to change notification settings - Fork 267
58 lines (51 loc) · 1.72 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Weekly Release
on:
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
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: 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: true # change this to false once it works
- 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