-
Notifications
You must be signed in to change notification settings - Fork 14
90 lines (81 loc) · 2.88 KB
/
release.yml
File metadata and controls
90 lines (81 loc) · 2.88 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
name: Release
on:
push:
branches: [main, "worker/**"]
permissions:
contents: write
pull-requests: write
jobs:
release-please:
name: Release Please
runs-on: blacksmith-2vcpu-ubuntu-2404
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
build-release:
name: Build Release Artifacts
runs-on: blacksmith-32vcpu-ubuntu-2404
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: "platform-ci"
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y bash ripgrep
- name: Build release binaries
run: cargo build --release
- name: Package binaries
run: |
mkdir -p release
cp target/release/validator-node release/
cp target/release/platform-sudo release/ 2>/dev/null || true
tar -czvf platform-${{ needs.release-please.outputs.version }}-linux-x86_64.tar.gz -C release .
- name: Upload release artifacts
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
files: |
platform-${{ needs.release-please.outputs.version }}-linux-x86_64.tar.gz
docker-release:
name: Docker Release
runs-on: blacksmith-32vcpu-ubuntu-2404
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Ensure Docker available
run: scripts/install-docker.sh
- uses: useblacksmith/setup-docker-builder@v1
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}},value=${{ needs.release-please.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release-please.outputs.version }}
type=semver,pattern={{major}},value=${{ needs.release-please.outputs.version }}
type=raw,value=latest
- uses: useblacksmith/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}