-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.4 KB
/
main.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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- "main"
- "yannic-tag-main"
env:
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPAL_RPC_CREDENTIALS: ${{ secrets.OPAL_RPC_CREDENTIALS }}
jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Build
# run: bazel build //...
publish:
runs-on: ubuntu-latest
# needs:
# - test
if: github.ref == 'refs/heads/yannic-tag-main'
steps:
- uses: actions/checkout@v4
- name: Create release
env:
GIT_AUTHOR_NAME: "EngFlow"
GIT_AUTHOR_EMAIL: "[email protected]"
GIT_COMMITTER_NAME: "EngFlow"
GIT_COMMITTER_EMAIL: "[email protected]"
run: |
VERSION="v$(date -u '+%Y.%m.%d-%H.%M.%S')"
# 1. Download `buildozer`
curl -o "${RUNNER_TEMP}/buildozer" -L "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-linux-amd64"
chmod +x "${RUNNER_TEMP}/buildozer"
# 2. Update `MODULE.bazel` and commit.
"${RUNNER_TEMP}/buildozer" "set version ${VERSION}" "//MODULE.bazel:engflowapis"
git add "MODULE.bazel"
git commit -m "Release ${VERSION}"
# 3. Push release tag.
git tag "${VERSION}" "HEAD"
git push origin "${VERSION}"