-
-
Notifications
You must be signed in to change notification settings - Fork 2
156 lines (151 loc) · 5.22 KB
/
Copy pathmain.yml
File metadata and controls
156 lines (151 loc) · 5.22 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: musl-dyne
on:
push:
paths-ignore:
- '*.md'
branches:
- master
pull_request:
paths-ignore:
- '*.md'
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
semantic-release:
name: 🤖 Semantic release
runs-on: ubuntu-latest
outputs:
new_release_published: ${{ steps.semantic-release.outputs.new_release_published }}
new_release_version: ${{ steps.semantic-release.outputs.new_release_version }}
if: ${{ github.ref_name == 'master' && github.event_name == 'push' }}
steps:
- uses: actions/checkout@v6
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v6
id: semantic-release
with:
extra_plugins: |
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
gcc-musl-build:
name: 🐧 Build release
runs-on: ubuntu-latest
needs: [semantic-release]
if: ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
strategy:
matrix:
include:
- target: x86_64-linux-musl
output: x86_64
- target: arm-linux-musleabihf
output: arm_hf
- target: riscv64-linux-musl
output: riscv_64
- target: aarch64-linux-musl
output: arm_64
fail-fast: true
env:
CCACHE_DIR: /alpine/root/.cache/ccache
XZ_OPT: -9e -T0
TARGET: ${{ matrix.target }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: prepare ccache in alpine chroot
run: |
sudo mkdir -p /alpine/root/.cache/ccache
sudo chmod -R a+rw /alpine/root/.cache
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: Build chroot ${{ matrix.target }}
run: |
sudo make chroot
echo "export ARCH=\"${{ matrix.target }}\"" | sudo tee /alpine/etc/profile
- name: Build gcc-musl ${{ matrix.target }}
run: |
/alpine/enter-chroot make gcc
- name: Build libs ${{ matrix.target }}
run: |
/alpine/enter-chroot make libs
- name: Prepare ${{ matrix.target }}
run: |
/alpine/enter-chroot make prepare
- name: Compress the package
run: |
echo "Compressing: dyne-gcc-musl-${{ matrix.output }}.tar.xz"
tar -cJf dyne-gcc-musl-${{ matrix.output }}.tar.xz dyne
- name: Upload release artifacts dyne-gcc-musl-${{ matrix.output }}
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.output }}
path: |
dyne-gcc-musl-${{ matrix.output }}.tar.xz
draft-binary-release:
name: 📦 Upload release
needs: [semantic-release, gcc-musl-build]
runs-on: ubuntu-latest
steps:
- name: download binary artifacts
uses: actions/download-artifact@v7
with:
path: |
dyne-gcc-musl
- name: show directory structure
run: tree -dL 3 dyne-gcc-musl
- name: compute sha256 hash checksums
run: |
mkdir -p dyne-gcc-musl/checksums
find dyne-gcc-musl -type f -exec sha256sum {} \; | awk '{ split($2, a, "/"); print $1, a[length(a)] }' | tee dyne-gcc-musl/checksums/SHA256SUMS.txt
- name: upload releases to files.dyne.org
uses: appleboy/scp-action@v1
with:
host: ${{ secrets.FILES_SSH_HOST }}
username: ${{ secrets.FILES_SSH_USER }}
key: ${{ secrets.FILES_SSH_KEY }}
port: ${{ secrets.FILES_SSH_PORT }}
# scp-drone uploads dirs if wildcards are in them, so here
# we need to list uploaded files one by one.
source: |
dyne-gcc-musl/release-x86_64/dyne-gcc-musl-x86_64.tar.xz,
dyne-gcc-musl/release-arm_hf/dyne-gcc-musl-arm_hf.tar.xz,
dyne-gcc-musl/release-arm_64/dyne-gcc-musl-arm_64.tar.xz,
dyne-gcc-musl/release-riscv_64/dyne-gcc-musl-riscv_64.tar.xz,
dyne-gcc-musl/checksums/SHA256SUMS.txt
target: |
/srv/ftp/musl
strip_components: 2
overwrite: true
- name: relase all binary artifacts
uses: softprops/action-gh-release@v2
with:
files: |
dyne-gcc-musl/release-*/*
dyne-gcc-musl/checksums/SHA256SUMS.txt
tag_name: ${{ needs.semantic-release.outputs.new_release_version }}
draft: false
prerelease: false
fail_on_unmatched_files: true
generate_release_notes: true
remove-tag-on-fail:
name: 🧻 Remove tag on fail
needs: [semantic-release, gcc-musl-build]
runs-on: ubuntu-latest
if: ${{ (failure() || cancelled()) && needs.semantic-release.outputs.new_release_published == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Remove tag
uses: dev-drprasad/delete-tag-and-release@v1.0
with:
tag_name: ${{ needs.semantic-release.outputs.new_release_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_release: false
repo: dyne/musl