-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (41 loc) · 1.34 KB
/
build.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
# Run whenever code is pushed
on:
push:
name: Build
jobs:
build:
# This step runs on every push, ensures there is an artifact for each push
name: Build
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Get version
id: version
run: |
# Use git commit sha to identify the version
VERSION=$(git rev-parse --short ${{ github.sha }})
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Write version to metadata.json
uses: jossef/[email protected]
with:
file: metadata.json
field: version
value: ${{ steps.version.outputs.VERSION }}
- name: Create filename
id: filename
run: echo "FILENAME=mapeo-default-config_${{ steps.version.outputs.VERSION }}.mapeoconfig" >> "$GITHUB_OUTPUT"
- run: npm ci
- name: Build asset
id: build_asset
run: |
mkdir -p build
$(npm root)/.bin/mapeo-settings build -l 'en' -o build/${{ steps.filename.outputs.FILENAME }}
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.filename.outputs.FILENAME }}
path: build/${{ steps.filename.outputs.FILENAME }}