forked from humanlogio/humanlog
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (96 loc) · 3.17 KB
/
release-dev.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
name: Create a dev release
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: write
jobs:
build:
strategy:
matrix:
targets:
- name: linux-amd64
runner: ubuntu-latest
tags: pro
goos: linux
goarch: amd64
- name: linux-arm64
runner: ubuntu-latest
goos: linux
goarch: arm64
goenvs: CC=aarch64-linux-gnu-gcc CXX=x86_64-linux-gnu-g++
preinstall: sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: darwin-amd64
runner: macos-latest
tags: pro
goos: darwin
goarch: amd64
- name: darwin-arm64
runner: macos-latest
tags: pro
goos: darwin
goarch: arm64
name: ${{ matrix.targets.name }}
runs-on: ${{ matrix.targets.runner }}
env:
GOPRIVATE: "github.com/humanlogio/humanlog-pro"
GH_ACCESS_TOKEN_FOR_HUMANLOGPRO: ${{ secrets.GH_ACCESS_TOKEN_FOR_HUMANLOGPRO }}
CGO_ENABLED: 1
GOBIN: /usr/local/bin/
steps:
- name: Set up Go 1
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
- uses: actions/checkout@v3
with:
fetch-depth: 0
- if: ${{ matrix.targets.preinstall != '' }}
run: ${{ matrix.targets.preinstall }}
- run: echo "${HOME}/.humanlog/bin" >> $GITHUB_PATH
- run: curl https://humanlog.io/install_apictl.sh | bash
- run: git config --global --add safe.directory '*'
- run: git config --global url.https://[email protected]/.insteadOf https://github.com/
- run: go install github.com/goware/modvendor@latest
- run: go mod vendor
- run: modvendor -copy="**/*.a **/*.h" -v
- run: mkdir -p dist/${{ matrix.targets.goos }}-${{ matrix.targets.goarch }}
- run: ${{ matrix.targets.goenvs }} ./script/build.sh
env:
HUMANLOG_GOTAGS: ${{ matrix.targets.tags }}
GOOS: ${{ matrix.targets.goos }}
GOARCH: ${{ matrix.targets.goarch }}
- uses: actions/upload-artifact@v4
with:
name: humanlog-bins-${{ matrix.targets.goos }}-${{ matrix.targets.goarch }}
path: dist/*
publish:
name: "publish"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: echo "${HOME}/.humanlog/bin" >> $GITHUB_PATH
- run: curl https://humanlog.io/install_apictl.sh | bash
- uses: actions/upload-artifact/merge@v4
with:
name: humanlog-bins
pattern: humanlog-bins-*
separate-directories: true
delete-merged: true
- uses: actions/download-artifact@v4
with:
name: humanlog-bins
- run: ./script/publish.sh
env:
CHANNEL: "dev"
API_URL: "https://api.humanlog.dev"
HMAC_KEY_ID: ${{ secrets.DEV_HMAC_KEY_ID }}
HMAC_PRIVATE_KEY: ${{ secrets.DEV_HMAC_PRIVATE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_BINARIES_BUCKET_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_BINARIES_BUCKET_ACCESS_KEY }}