-
-
Notifications
You must be signed in to change notification settings - Fork 41
123 lines (104 loc) · 3.37 KB
/
github-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
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
name: GitHub release
on:
workflow_dispatch
env:
CACHE_PATHS: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
jobs:
get-build-info:
runs-on: ubuntu-latest
outputs:
new-ezno-version: ${{ steps.get-version.outputs.new-ezno-version }}
sponsors: ${{ steps.get-sponsors.outputs.sponsors }}
steps:
- uses: actions/checkout@v3
with:
fetch-tags: true
- name: Get version
id: get-version
run: |
tag=$(git for-each-ref --sort=creatordate --format '%(refname:short)' 'refs/tags/release/ezno-[0-9]*' | tail -n 1)
echo "Releasing ${tag:13}"
echo "new-ezno-version=${tag:13}" >> $GITHUB_OUTPUT
- id: get-sponsors
run: |
SPONSORS=$(gh api graphql -f query='{
user(login: "kaleidawave") {
sponsorshipsAsMaintainer(first: 100, activeOnly: false) {
edges {
node {
sponsor {
login
}
}
}
}
}
}' -q '.data.user.sponsorshipsAsMaintainer.edges | map(.node.sponsor.login) | join(", ")')
echo "sponsors=$SPONSORS" >> $GITHUB_OUTPUT
shell: bash
env:
GH_TOKEN: ${{ github.token }}
build:
needs: [get-build-info]
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
executable-extension: .exe
platform_name: x86_64-pc-windows
- os: ubuntu-latest
platform_name: x86_64-unknown-linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build binary
run: cargo build --release
env:
SPONSORS: ${{ needs.get-build-info.outputs.sponsors }}
- name: Rename and move release assets
run: |
mkdir artifacts
mv target/release/ezno${{ matrix.executable-extension }} artifacts/ezno-${{ needs.get-build-info.outputs.new-ezno-version }}-${{ matrix.platform_name }}${{ matrix.executable-extension }}
- uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ matrix.os }}
path: artifacts/*
if-no-files-found: error
retention-days: 1
github-release:
needs: [build, get-build-info]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build-artifacts-windows-latest
path: build-artifacts
- uses: actions/download-artifact@v3
with:
name: build-artifacts-ubuntu-latest
path: build-artifacts
- name: Print artifacts
run: |
echo "::group::Build artifacts"
ls -R build-artifacts
echo "::endgroup::"
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: "Ezno ${{ needs.get-build-info.outputs.new-ezno-version }}"
tag_name: "release/ezno-${{ needs.get-build-info.outputs.new-ezno-version }}"
body: "For @kaleidawave to update"
files: |
README.md
build-artifacts/*