-
Notifications
You must be signed in to change notification settings - Fork 94
112 lines (97 loc) · 3.35 KB
/
release.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
104
105
106
107
108
109
110
111
112
name: Build and publish release
on:
push:
tags:
- 'v*'
jobs:
build-and-publish-release:
name: Build Application And Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache rust dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build application
run: |
./scripts/init.sh
cargo build --release
cat extras/customSpecRaw.json > customSpecRaw.json
- name: Prepare artifact
run: |
zip PolkadexNodeUbuntu.zip --junk-paths target/release/polkadex-node extras/customSpecRaw.json extras/polkadex.service
zip PolkadexParachainNode.zip --junk-paths target/release/parachain-polkadex-node
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
PolkadexNodeUbuntu.zip
customSpecRaw.json
PolkadexParachainNode.zip
name: Release ${{ github.ref_name }}
prerelease: false
draft: false
- name: Upload mainnet node artifact
uses: actions/upload-artifact@v3
with:
name: PolkadexNodeUbuntu
path: ./PolkadexNodeUbuntu.zip
if-no-files-found: error
- name: Upload parachain node artifact
uses: actions/upload-artifact@v3
with:
name: PolkadexParachainNode
path: ./PolkadexParachainNode.zip
if-no-files-found: error
push-to-docker-registry:
name: Push Docker Image To Docker Hub
runs-on: ubuntu-latest
needs: [ build-and-publish-release ]
steps:
- name: Log in to the Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Extract metadata (tags, labels) for docker
id: meta
uses: docker/metadata-action@v4
with:
images: polkadex/mainnet
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: PolkadexNodeUbuntu
- name: Unzip artifact
run: unzip PolkadexNodeUbuntu.zip -d ${{ github.workspace }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v3
with:
push: true
file: ${{ github.workspace }}/.docker/ci/release/Dockerfile
context: ${{ github.workspace }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
update-on-finality:
name: OnFinality Network Spec Update
runs-on: ubuntu-latest
needs: [ build-and-publish-release, push-to-docker-registry ]
steps:
- name: Update image version of the existing network spec
uses: OnFinality-io/action-onf-release@v1
with:
onf-access-key: ${{ secrets.ONF_ACCESS_KEY }}
onf-secret-key: ${{ secrets.ONF_SECRET_KEY }}
onf-workspace-id: ${{ secrets.ONF_WORKSPACE_ID }}
onf-network-key: ${{ secrets.ONF_NETWORK_KEY }}
onf-sub-command: image
onf-action: add
image-version: ${{ github.ref_name }}