-
Notifications
You must be signed in to change notification settings - Fork 10
72 lines (61 loc) · 2.15 KB
/
release-sqlite-db.yml
File metadata and controls
72 lines (61 loc) · 2.15 KB
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
name: Release – SQLite DBs (Policies & Store)
on:
pull_request:
types: [closed]
branches:
- master
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Define release name (once for all steps)
run: echo "RELEASE_NAME=$(date +'%Y%m%d%H%M')" >> $GITHUB_ENV
- name: Set up Java 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*','**/gradle-wrapper.properties') }}
- name: Build project and export SQLite DBs
run: |
# Build and run both generators using the new task
./gradlew runGenerators --quiet
# Verify the generated database files
ls -l generators/policies/build/policies-database.db
ls -l generators/store/build/store-database-en.db
ls -l generators/store/build/store-database-fr.db
ls -l generators/store/build/store-database-he.db
- name: Create and push tag
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${process.env.RELEASE_NAME}`,
sha: context.sha
})
- name: Create GitHub release and upload artifacts
uses: softprops/action-gh-release@v2.1.0
with:
tag_name: ${{ env.RELEASE_NAME }}
name: ${{ env.RELEASE_NAME }}
files: |
generators/policies/build/policies-database.db
generators/store/build/store-database-en.db
generators/store/build/store-database-fr.db
generators/store/build/store-database-he.db