-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (114 loc) · 4.36 KB
/
package.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Release Debian package
on:
push:
tags:
- "v*.*.*" # run on semver tags
- "v*.*.*-*" # run on pre-release tags
workflow_dispatch:
inputs:
tag:
description: 'Tag to stable release'
required: true
default: 'v0.0.0'
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build Next.js application
run: bun run build
- name: Extract version from tag
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Update control file version
run: |
sed -i "s/^Version: .*/Version: ${VERSION}/" debian/DEBIAN/control
- name: Prepare Debian package structure
run: |
cp -rT .next/standalone debian/usr/share/dashboard
cp -r .next/static debian/usr/share/dashboard/.next
cp -r public debian/usr/share/dashboard
- name: Build Debian package
run: dpkg-deb --build debian relayer-admin-dashboard.deb
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Sign debian package
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_YES: true
run: |
cosign sign-blob --key env://COSIGN_PRIVATE_KEY relayer-admin-dashboard.deb
cosign public-key --key env://COSIGN_PRIVATE_KEY > cosign.pub
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
relayer-admin-dashboard.deb
relayer-admin-dashboard.deb.sig
cosign.pub
generate_release_notes: true
make_latest: true
prerelease: ${{ contains(github.ref_name, '-') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build relayer image
id: build-and-push-relayer
uses: docker/build-push-action@v6
with:
context: https://github.com/icon-project/relayer-docker.git#:admin-dashboard
platforms: linux/amd64,linux/arm64
push: true
build-args: |
- DASHBOARD_VERSION=${{ github.ref_name }}
tags: |
iconcommunity/relayer-admin-dashboard:unstable
iconcommunity/relayer-admin-dashboard:${{ github.ref_name }}
- name: Sign relayer image
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_YES: true
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY iconcommunity/relayer-admin-dashboard:unstable
cosign sign --key env://COSIGN_PRIVATE_KEY iconcommunity/relayer-admin-dashboard:${{ github.ref_name }}
release:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Pull relayer image
run: docker pull iconcommunity/relayer-admin-dashboard:${{ github.event.inputs.tag }}
- name: Tag with stable
run: docker tag iconcommunity/relayer-admin-dashboard:${{ github.event.inputs.tag }} iconcommunity/relayer-admin-dashboard:stable
- name: Push relayer image
run: docker push iconcommunity/relayer-admin-dashboard:stable
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Sign relayer image
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_YES: true
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY iconcommunity/relayer-admin-dashboard:stable