-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (75 loc) · 2.36 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
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker Layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx
restore-keys: ${{ runner.os }}-buildx-
- name: Build and Push
uses: docker/bake-action@v4
env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
GIT_COMMIT: ${{ github.sha }}
GIT_VERSION: ${{ github.ref_name }}
IMAGE_TAGS: ${{ github.ref_name }}
with:
files: docker-bake.hcl
push: true
set: |
*.platform=linux/amd64,linux/arm64
*.cache-from=type=local,src=/tmp/.buildx-cache
*.cache-to=type=local,dest=/tmp/.buildx-cache,mode=max
binaries.output=type=local,dest=./binaries
- name: Compress Binaries
run: |
(cd binaries/linux_amd64 && zip -q - oasvlfy) > oasvlfy-${{ github.ref_name }}-linux-amd64.zip
(cd binaries/linux_arm64 && zip -q - oasvlfy) > oasvlfy-${{ github.ref_name }}-linux-arm64.zip
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.ref_name }}
path: oasvlfy-*.zip
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ github.ref_name }}
path: artifacts
- name: Create sha256sums.txt
run: (cd artifacts && sha256sum *) > sha256sums.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: true
files: |
artifacts/*.zip
sha256sums.txt