forked from thesamet/sbt-protoc
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.29 KB
/
ci.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: ci
on:
push:
branches:
- '**'
workflow_dispatch:
inputs:
clean_build:
description: 'build all'
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 25
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -XX:MinRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -XX:MinRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0 -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
steps:
- id: checkout
uses: actions/checkout@v3
with:
fetch-depth: 100
fetch-tags: true
sparse-checkout-cone-mode: false
# set vars
- name: set vars
uses: ./.github/actions/set_vars
with:
clean_build: ${{ github.event.inputs.clean_build }}
- name: Setup Scala
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: 'temurin'
- name: restore cache
uses: ./.github/actions/scala_restore_cache
with:
clean_build: ${{ github.event.inputs.clean_build }}
- name: Setup M2 Credentials
run: mkdir -p ~/.m2 && echo ${{secrets.M2_CREDENTIALS}} | base64 -d > ~/.m2/.credentials
- name: set branch
run: |
branch="$(echo -n ${{ github.event.ref }} | sed 's#refs/heads/##g; s#/#-#g' | tr '[:upper:]' '[:lower:]')"
echo "branch=\"${branch}\"" >> $GITHUB_ENV
- name: set new version
run: |
if [[ ${{env.branch}} == "master" ]]; then
version="$(date +'%Y.%m.%d')-${{github.run_number}}"
else
version="$(date +'%Y.%m.%d')-${branch}-${{github.run_number}}"
fi
version=$(echo $version | sed 's/"//g')
echo "version=$version"
echo "version=$version" >> $GITHUB_ENV
- run: |
echo "version in ThisBuild := \"${{env.version}}\"" > version.sbt
- run: sbt publish
- name: label vcs
run: git tag $version && git push --tag
- name: Save Scala Cache
uses: ./.github/actions/scala_save_cache