-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (78 loc) · 2.07 KB
/
ci.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
name: CI
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
build:
strategy:
matrix:
platform: [ linux/amd64, linux/arm64, linux/arm/v5, linux/arm/v6, linux/arm/v7, linux/386, darwin/amd64, darwin/arm64, windows/amd64, windows/386 ]
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
- name: Load version
id: version
run: |
source .versions
echo "TAGLIB_VERSION=$TAGLIB_VERSION" >> $GITHUB_ENV
echo "TAGLIB_SHA=$TAGLIB_SHA" >> $GITHUB_ENV
- name: Build
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: ${{ matrix.platform }}
outputs: |
type=local,dest=./output
target: artifact
build-args: |
TAGLIB_VERSION=${{ env.TAGLIB_VERSION }}
TAGLIB_SHA=${{ env.TAGLIB_SHA }}
- name: Sanitize platform name
id: set-platform
run: |
PLATFORM=$(echo ${{ matrix.platform }} | tr '/' '-')
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
- name: Create artifact
id: create-artifact
run: |
mkdir -p ./dist
tar -czf ./dist/taglib-${{ env.PLATFORM }}.tar.gz -C ./output .
- uses: actions/upload-artifact@v4
with:
name: ${{ env.PLATFORM }}
path: ./dist
retention-days: 7
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: ./dist
merge-multiple: true
- run: ls -lR ./dist
- name: Generate checksums
run: |
cd ./dist
sha256sum * > checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: ./dist/*
generate_release_notes: true
make_latest: true