-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (117 loc) Β· 3.5 KB
/
release.yaml
File metadata and controls
137 lines (117 loc) Β· 3.5 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
name: Release
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
on:
push:
branches:
- "main"
env:
PROJECT_NAME: http-server
JUST_VERSION: "1.36.0"
jobs:
test:
name: π§ͺ Test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: just test
format:
name: π Format
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: just fmt
lint:
name: π€ Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- run: just lint
build:
strategy:
matrix:
config:
- name: π₯ Linux AMD64
os: linux
arch: amd64
runner: ubuntu-24.04
run: rustup target add x86_64-unknown-linux-musl
- name: π₯ Linux ARM64
os: linux
arch: arm64
runner: ubuntu-24.04-arm
run: rustup target add aarch64-unknown-linux-musl
- name: π MacOS AMD64
os: macos
arch: amd64
runner: macos-13
- name: π MacOS ARM64
os: macos
arch: arm64
runner: macos-15
- name: π¦ Windows AMD64
os: windows
arch: amd64
runner: windows-latest
- name: π¦ Windows ARM64
os: windows
arch: arm64
runner: windows-latest
run: rustup target add aarch64-pc-windows-msvc
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runner }}
steps:
- uses: actions/checkout@v4
- run: eval $(curl -sSf sh.davidalsh.com/just.sh | sh)
- run: eval $(curl -sSf sh.davidalsh.com/rust.sh | sh)
- if: matrix.config.run
run: ${{ matrix.config.run }}
- env:
os: "${{ matrix.config.os }}"
arch: "${{ matrix.config.arch }}"
profile: "release"
run: just build
- uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.config.os }}-${{ matrix.config.arch }}
path: ${{ github.workspace }}/target/${{ matrix.config.os }}-${{ matrix.config.arch }}/**/*
if-no-files-found: error
retention-days: 1
publish-github-release:
name: "π Publish Github Release"
runs-on: ubuntu-24.04
needs:
- test
- format
- lint
- build
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with: { path: artifacts }
- name: Publish` Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
TAG="$(date -u +"v%Y.%m.%d.%H%M").${GITHUB_SHA::4}"
echo "Tag: ${TAG}"
gh release create $TAG --draft --notes "Automatically built binaries"
gh release edit $TAG --title "π Latest"
cd artifacts
for name in *; do
cd "${{ github.workspace }}/artifacts/${name}/release"
tar -czvf ./${name}.tar.gz ./*
gh release upload $TAG ${name}.tar.gz
done
gh release edit $TAG --draft=false