Skip to content

Commit 3301c6a

Browse files
workflow
1 parent e9b8401 commit 3301c6a

1 file changed

Lines changed: 52 additions & 117 deletions

File tree

.github/workflows/release.yml

Lines changed: 52 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,52 @@
1-
# name: goreleaser
2-
3-
# on:
4-
# push:
5-
# tags:
6-
# - "v*"
7-
8-
# jobs:
9-
# goreleaser:
10-
# runs-on: macos-latest
11-
# steps:
12-
# - name: Install Go
13-
# uses: actions/setup-go@v4
14-
# with:
15-
# go-version: 1.22.x
16-
# check-latest: true
17-
18-
# - name: Check Out Repo
19-
# uses: actions/checkout@v3
20-
21-
# - name: Install the Apple certificate and provisioning profile
22-
# env:
23-
# BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
24-
# P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
25-
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
26-
# run: |
27-
# # create variables
28-
# CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
29-
# KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
30-
31-
# # import certificate and provisioning profile from secrets
32-
# echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
33-
34-
# # create temporary keychain
35-
# security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
36-
# security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
37-
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
38-
39-
# # import certificate to keychain
40-
# security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
41-
# security list-keychain -d user -s $KEYCHAIN_PATH
42-
43-
# - name: Release Notes
44-
# run: ./scripts/release_notes.sh > ./release_notes.md
45-
46-
# - name: GoReleaser
47-
# uses: goreleaser/goreleaser-action@v4
48-
# with:
49-
# version: latest
50-
# args: release --release-notes=./release_notes.md --timeout 60m
51-
# env:
52-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
# APPLE_DEVELOPER_PASSWORD: ${{ secrets.APPLE_DEVELOPER_PASSWORD }}
54-
# APPLE_DEVELOPER_USERNAME: ${{ secrets.APPLE_DEVELOPER_USERNAME }}
55-
# APPLE_DEVELOPER_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }}
56-
57-
# docker:
58-
# runs-on: ubuntu-latest
59-
# steps:
60-
# - name: Install Go
61-
# uses: actions/setup-go@v3
62-
# with:
63-
# go-version: 1.22.x
64-
# check-latest: true
65-
66-
# - name: Check Out Repo
67-
# uses: actions/checkout@v3
68-
69-
# - name: Login to Docker Hub
70-
# uses: docker/login-action@v1
71-
# with:
72-
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
73-
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
74-
75-
# - name: Install Buildx
76-
# id: buildx
77-
# uses: docker/setup-buildx-action@v1
78-
79-
# - name: Docker meta
80-
# id: meta
81-
# uses: docker/metadata-action@v4
82-
# with:
83-
# images: luyuanxin1995/bricksllm
84-
# tags: |
85-
# type=semver,pattern={{version}}
86-
# type=semver,pattern={{major}}.{{minor}}
87-
# type=semver,pattern={{major}}
88-
89-
# - name: Docker meta
90-
# id: meta-datadog
91-
# uses: docker/metadata-action@v4
92-
# with:
93-
# images: luyuanxin1995/bricksllm-datadog
94-
# tags: |
95-
# type=semver,pattern={{version}}
96-
# type=semver,pattern={{major}}.{{minor}}
97-
# type=semver,pattern={{major}}
98-
99-
# - name: Build and push
100-
# uses: docker/build-push-action@v2
101-
# with:
102-
# context: ./
103-
# file: ./Dockerfile.prod
104-
# builder: ${{ steps.buildx.outputs.name }}
105-
# platforms: linux/amd64,linux/arm64
106-
# push: true
107-
# tags: ${{ steps.meta.outputs.tags }}
108-
109-
# - name: Build and push
110-
# uses: docker/build-push-action@v2
111-
# with:
112-
# context: ./
113-
# file: ./Dockerfile.datadog
114-
# builder: ${{ steps.buildx.outputs.name }}
115-
# platforms: linux/amd64,linux/arm64
116-
# push: true
117-
# tags: ${{ steps.meta-datadog.outputs.tags }}
1+
name: Publish New Release
2+
on:
3+
release:
4+
types: [created]
5+
6+
jobs:
7+
releases-matrix:
8+
name: Release Go Binary
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
goos: [linux]
13+
goarch: [amd64]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-go@v4
17+
with:
18+
go-version: '^1.22'
19+
20+
- name: make dist
21+
run: mkdir -p dist
22+
23+
- name: build
24+
run: go build -ldflags "-s -w" -o dist/ ./...
25+
env:
26+
CGO_ENABLED: 0
27+
GOOS: ${{ matrix.goos }}
28+
GOARCH: ${{ matrix.goarch }}
29+
30+
- name: Tar Folder
31+
if: ${{ matrix.goos != 'windows'}}
32+
run: tar czf ../release.tgz ./
33+
working-directory: dist
34+
35+
36+
- name: Upload To Artifactory
37+
if: ${{ matrix.goos != 'windows'}}
38+
run: curl --fail -i -u"${BINARY_REPOSITORY_CREDENTIALS}" -T release.tgz "${BINARY_REPOSITORY_URL}/component-builds/BricksLLM-${GIT_HASH}.tar.gz"
39+
env:
40+
BINARY_REPOSITORY_URL: ${{ secrets.BINARY_REPOSITORY_URL }}
41+
GIT_HASH: ${{ github.sha }}
42+
BINARY_REPOSITORY_CREDENTIALS: ${{ secrets.BINARY_REPOSITORY_USER }}:${{ secrets.BINARY_REPOSITORY_PASSWORD }}
43+
44+
- name: Upload release assets
45+
uses: actions/upload-release-asset@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ github.event.release.upload_url }}
50+
asset_name: BricksLLM-${{ matrix.goos }}-${{ matrix.goarch }}.${{ matrix.goos == 'windows' && 'zip' || 'tgz' }}
51+
asset_path: ${{ matrix.goos == 'windows' && 'release.zip' || 'release.tgz' }}
52+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)