-
Notifications
You must be signed in to change notification settings - Fork 5
141 lines (129 loc) · 5.61 KB
/
build-master.yml
File metadata and controls
141 lines (129 loc) · 5.61 KB
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
name: Build master
on:
push:
branches:
- 'master'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
check_source:
name: "Run code checks"
uses: ./.github/workflows/_shared-check.yaml
build_binaries:
name: "Build bootnodoor"
needs: [check_source]
uses: ./.github/workflows/_shared-build.yaml
with:
ref: ${{ github.sha }}
release: "snapshot"
docker: true
docker_repository: "ethpandaops/bootnodoor"
docker_tag_prefix: "master"
additional_tags: "['master','master-latest']"
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
create_snapshot_release:
name: Create snapshot release
needs: [build_binaries]
runs-on: ubuntu-latest
steps:
# download build artifacts
- name: "Download build artifacts"
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
# (re)create snapshot binary release
- name: Update snapshot tag & remove previous snapshot release
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
try {
var snapshotTag = "snapshot";
var snapshotRelease = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: snapshotTag
});
if(snapshotRelease && snapshotRelease.data && snapshotRelease.data.tag_name == snapshotTag) {
console.log("delete previous snapshot release");
await github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: snapshotRelease.data.id
});
}
var snapshotRef = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/" + snapshotTag
});
if(snapshotRef && snapshotRef.data && snapshotRef.data.ref) {
if(snapshotRef.data.object.sha !== context.sha) {
await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/" + snapshotTag,
sha: context.sha,
});
}
}
else {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/" + snapshotTag,
sha: context.sha,
});
}
} catch (e) {
console.log(e)
}
# generate release artifacts
- name: "Generate release package: bootnodoor_snapshot_windows_amd64.zip"
run: |
cd bootnodoor_windows_amd64
zip -r -q ../bootnodoor_snapshot_windows_amd64.zip .
- name: "Generate release package: bootnodoor_snapshot_linux_amd64.tar.gz"
run: |
cd bootnodoor_linux_amd64
tar -czf ../bootnodoor_snapshot_linux_amd64.tar.gz .
- name: "Generate release package: bootnodoor_snapshot_linux_arm64.tar.gz"
run: |
cd bootnodoor_linux_arm64
tar -czf ../bootnodoor_snapshot_linux_arm64.tar.gz .
- name: "Generate release package: bootnodoor_snapshot_darwin_amd64.tar.gz"
run: |
cd bootnodoor_darwin_amd64
tar -czf ../bootnodoor_snapshot_darwin_amd64.tar.gz .
- name: "Generate release package: bootnodoor_snapshot_darwin_arm64.tar.gz"
run: |
cd bootnodoor_darwin_arm64
tar -czf ../bootnodoor_snapshot_darwin_arm64.tar.gz .
- name: Create snapshot release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
draft: false
prerelease: true
name: "Dev Snapshot"
tag_name: "snapshot"
body: |
## Latest automatically built executables. (Unstable development snapshot)
Built from master branch (commit: ${{ github.sha }})
### Release Artifacts
| Release File | Description |
| ------------- | ------------- |
| [bootnodoor_snapshot_windows_amd64.zip](https://github.com/ethpandaops/bootnodoor/releases/download/snapshot/bootnodoor_snapshot_windows_amd64.zip) | bootnodoor executables for windows/amd64 |
| [bootnodoor_snapshot_linux_amd64.tar.gz](https://github.com/ethpandaops/bootnodoor/releases/download/snapshot/bootnodoor_snapshot_linux_amd64.tar.gz) | bootnodoor executables for linux/amd64 |
| [bootnodoor_snapshot_linux_arm64.tar.gz](https://github.com/ethpandaops/bootnodoor/releases/download/snapshot/bootnodoor_snapshot_linux_arm64.tar.gz) | bootnodoor executables for linux/arm64 |
| [bootnodoor_snapshot_darwin_amd64.tar.gz](https://github.com/ethpandaops/bootnodoor/releases/download/snapshot/bootnodoor_snapshot_darwin_amd64.tar.gz) | bootnodoor executable for macos/amd64 |
| [bootnodoor_snapshot_darwin_arm64.tar.gz](https://github.com/ethpandaops/bootnodoor/releases/download/snapshot/bootnodoor_snapshot_darwin_arm64.tar.gz) | bootnodoor executable for macos/arm64 |
files: |
bootnodoor_snapshot_windows_amd64.zip
bootnodoor_snapshot_linux_amd64.tar.gz
bootnodoor_snapshot_linux_arm64.tar.gz
bootnodoor_snapshot_darwin_amd64.tar.gz
bootnodoor_snapshot_darwin_arm64.tar.gz