-
-
Notifications
You must be signed in to change notification settings - Fork 24
103 lines (96 loc) · 3.02 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
on: push
name: CI
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
node-version: [ 18.x ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: yarn install
run: yarn install
- name: Package release archive
run: yarn run package
- name: Save release archive
uses: actions/upload-artifact@v2
with:
name: release-archive-${{ matrix.os }}
path: build/*.zip
build-and-push-image:
name: Build and push image
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
publish-release:
name: Publish release
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: npm publish --access public
- name: Fetch release archives
uses: actions/download-artifact@v3
- name: Get the tag name
id: tag
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
- name: Create github release
uses: felixbrucker/github-actions/publish-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --name Chia-Dashboard-Satellite
- uses: AButler/upload-release-assets@v2.0
with:
files: 'release-archive-*/*.zip'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.TAG }}