-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.31 KB
/
build.yaml
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
name: Build
on:
pull_request:
types: [synchronize, opened, reopened]
concurrency:
group: build
cancel-in-progress: true
jobs:
build-and-publish:
name: Build and Publish
runs-on: self-hosted-hoprnet-small
steps:
- name: Setup uhttp repository
id: setup
uses: hoprnet/uhttp-crypto/.github/actions/setup@main
with:
node-version: 20
google-credentials: ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }}
- name: Building
run: yarn build
- name: Linting
run: yarn lint:ci
- name: Formatting
run: yarn format:ci
- name: Testing
run: yarn test
- name: Publish next version
run: |
BUILD_DATE=$(date +%Y%m%d%H%M%S)
PR_VERSION=$(node -p "require('./package.json').version")-pr.${{ github.event.pull_request.number }}
jq --arg version "${PR_VERSION}-${BUILD_DATE}" '.version = $version' package.json > temp.json
mv temp.json package.json
yarn publish --no-git-tag-version --tag next
env:
NODE_AUTH_TOKEN: ${{ steps.setup.outputs.access_token }}