This repository was archived by the owner on Jul 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 180
120 lines (104 loc) · 3.3 KB
/
publish.yml
File metadata and controls
120 lines (104 loc) · 3.3 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
name: "Publish nox"
on:
workflow_call:
inputs:
tag:
type: string
description: "tag to publish"
required: true
version:
type: string
description: "nox version"
required: true
jobs:
build:
uses: ./.github/workflows/build.yml
with:
ref: ${{ inputs.tag }}
push:
name: "Build and push container image"
runs-on: ubuntu-latest
timeout-minutes: 60
needs: build
permissions:
contents: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: fluencelabs/nox
ref: ${{ inputs.tag }}
- name: Import secrets
uses: hashicorp/vault-action@v3.0.0
with:
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
secrets: |
kv/hub.docker.com/fluencebot username | DOCKER_USERNAME ;
kv/hub.docker.com/fluencebot password | DOCKER_PASSWORD
- name: Download nox binaries
uses: actions/download-artifact@v4
with:
path: docker/binaries
- name: Set build date
run: echo "BUILD_DATE=$(date '+%Y-%m-%dT%H:%M:%S%:z')" >> $GITHUB_ENV
- name: Calculate SHA256
id: sha
working-directory: docker
run: |
# Calculate sha256
for arch in amd64 arm64; do
cp binaries/nox-${arch}/nox nox-${arch}
du -hs nox-${arch}
sha256sum nox-${arch} | tee >> nox_SHA256_SUMS
sha=($(sha256sum nox-${arch}))
echo "sha256_${arch}=${sha}" >> $GITHUB_OUTPUT
done
- name: Upload nox binary
uses: softprops/action-gh-release@v2
with:
files: |
./docker/nox-amd64
./docker/nox-arm64
./docker/nox_SHA256_SUMS
tag_name: ${{ inputs.tag }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Build and push container
id: docker
uses: docker/build-push-action@v5
with:
context: ./docker
push: true
platforms: linux/amd64,linux/arm64
tags: |
fluencelabs/nox:unstable
fluencelabs/nox:${{ inputs.version }}
labels: |
org.opencontainers.image.version=${{ inputs.version }}
org.opencontainers.image.created=${{ env.BUILD_DATE }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Update docker hub description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
repository: fluencelabs/nox
short-description: |
Rust implementation of the Fluence network peer.
https://github.com/fluencelabs/nox
readme-filepath: ./docker/README.md