-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 2.34 KB
/
release.yml
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
59
60
61
62
on:
push:
# To create a new release, git tag vX.X.X; git push origin --tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Linux X86 64 binary
shell: bash
run: |
tools/bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //bazel_disk_cache_cleaner
mv bazel-bin/bazel_disk_cache_cleaner/bazel_disk_cache_cleaner_/bazel_disk_cache_cleaner /tmp/bazel_disk_cache_cleaner_linux_amd64
- name: Build Darwin arm 64 binary
shell: bash
run: |
tools/bazel build --platforms=@io_bazel_rules_go//go/toolchain:darwin_arm64 //bazel_disk_cache_cleaner
mv bazel-bin/bazel_disk_cache_cleaner/bazel_disk_cache_cleaner_/bazel_disk_cache_cleaner /tmp/bazel_disk_cache_cleaner_darwin_arm64
- name: Build Darwin X86 64 binary
shell: bash
run: |
tools/bazel build --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 //bazel_disk_cache_cleaner
mv bazel-bin/bazel_disk_cache_cleaner/bazel_disk_cache_cleaner_/bazel_disk_cache_cleaner /tmp/bazel_disk_cache_cleaner_darwin_amd64
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
```
http_archive(
name = "bazel_disk_cache_cleaner",
strip_prefix = "${{ github.ref }}",
url = "https://github.com/Ryang20718/Bazel-Disk-Cache-Cleaner/archive/refs/tags/${{ github.ref }}.tar.gz",
)
```
draft: false
prerelease: false
- uses: xresloader/upload-to-github-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "/tmp/bazel_disk_cache_cleaner*"
release_id: ${{ steps.create_release.outputs.id }}
overwrite: true
verbose: true