-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (92 loc) · 2.62 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
name: Release
on:
workflow_dispatch:
push:
tags:
- "frontend-v*"
- "v*"
jobs:
build_static:
uses: ministruth/.github/.github/workflows/build_static.yml@main
with:
upload: true
build_skynet:
uses: ministruth/.github/.github/workflows/build.yml@main
with:
prefix: skynet
upload: true
args: -p skynet
release:
needs: [build_static, build_skynet]
uses: ministruth/.github/.github/workflows/release.yml@main
with:
prefix: skynet
static: true
cmd: |
rm -rf */plugin/*
mkdir -p skynet-linux-x86_64/assets/_plugin
mkdir -p skynet-linux-i686/assets/_plugin
mkdir -p skynet-linux-aarch64/assets/_plugin
mkdir -p skynet-windows-x86_64/assets/_plugin
mkdir -p skynet-macOS-x86_64/assets/_plugin
mkdir -p skynet-macOS-aarch64/assets/_plugin
publish_crate:
needs: build_skynet
name: Publish crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Push to crate.io
run: |
cd skynet_macro
cargo publish --no-verify || true
cd -
cd skynet_api
cargo publish --no-verify || true
cd -
push_dockerhub:
needs: build_skynet
name: Push to dockerhub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: imwxz/skynet
- uses: actions/download-artifact@v4
with:
path: release
pattern: skynet-linux-*
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: static
path: assets
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- run: |
cd release
cp -r ../assets skynet-linux-x86_64
cp -r ../assets skynet-linux-aarch64
mv skynet-linux-x86_64 amd64
mkdir -p amd64/assets/_plugin
mv skynet-linux-aarch64 arm64
mkdir -p amd64/assets/_plugin
cd -
- name: Build and push aarch64
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}