-
Notifications
You must be signed in to change notification settings - Fork 83
148 lines (139 loc) · 4.36 KB
/
draft-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
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
139
140
141
142
143
144
145
146
147
148
name: Publish draft release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
build-runtimes:
runs-on: [self-hosted, linux]
strategy:
matrix:
runtime: ["interlay", "kintsugi"]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Build ${{ matrix.runtime }} runtime
id: srtool_build
uses: chevdor/[email protected]
with:
image: docker.io/interlayhq/srtool
tag: nightly-2022-12-15
package: ${{ matrix.runtime }}-runtime-parachain
runtime_dir: ./parachain/runtime/${{ matrix.runtime }}
chain: ${{ matrix.runtime }}
workdir: ${{ github.workspace }}
- name: Store srtool digest to disk
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.runtime }}_srtool_output.json
- name: Upload ${{ matrix.runtime }} srtool json
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.runtime }}-srtool-json
path: ${{ matrix.runtime }}_srtool_output.json
- name: Upload ${{ matrix.runtime }} runtime
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.runtime }}-runtime
path: |
${{ steps.srtool_build.outputs.wasm_compressed }}
build-binary:
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-06-20
- run: |
find ./ -name Cargo.toml -exec ./scripts/update_cargo_version.sh {} \;
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --bin interbtc-parachain
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: interbtc
path: target/release/interbtc-parachain
build_docker:
runs-on: [self-hosted, linux]
needs: ["build-binary"]
steps:
- uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
TS=$(date +%s)
echo ::set-output name=branch_name::$(echo ${GITHUB_REF##*/})
echo ::set-output name=tag::${TAG}
echo ::set-output name=ts::${TS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup docker context for buildx
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: docker.io/interlayhq/interbtc
tags: |
type=sha,prefix=${{ steps.prep.outputs.branch_name }}-,suffix=-${{ steps.prep.outputs.ts }}
type=ref,event=branch
type=ref,event=tag
- uses: actions/download-artifact@v3
with:
name: interbtc
path: target/release/
- run: |
find ./target/
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
file: ./Dockerfile_release
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
publish-draft-release:
runs-on: [self-hosted, linux]
needs: ["build-runtimes", "build-binary"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
path: artifacts
- run: |
find ./artifacts
bash scripts/release_notes.sh
rm -v ./artifacts/*/*.json
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
draft: true
files: |
artifacts/*/*