-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (120 loc) · 4.68 KB
/
git2mail.yml
File metadata and controls
132 lines (120 loc) · 4.68 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
name: git2mail release
on:
push:
tags:
- "v*"
env:
GITHUB_REF: "${{ github.ref }}"
jobs:
build:
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl
cargo_arg: --release
- build: macos
os: macos-latest
cargo_arg: --release
- build: windows
os: windows-latest
cargo_arg: --release
extension: .exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f # v1.0.6
with:
toolchain: stable
- name: If target is musl, install musl-tools (including musl-gcc) and set target
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt update
sudo apt install musl-tools -y
rustup target add ${{ matrix.target }}
- name: Build
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # v1.0.1
with:
command: build
args: --release --all-features --package git2mail --verbose ${{ matrix.cargo_build }}
- name: Upload resulting 'git2mail'
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: git2mail-${{ matrix.build }}
path: ./target/${{ matrix.target }}/release/git2mail${{ matrix.extension }}
release:
# From https://github.com/cloudflare/wrangler/blob/master/.github/workflows/release.yml
name: GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Query version number
id: get_version
shell: bash
run: |
echo "using version tag ${GITHUB_REF:15}"
echo "version=${GITHUB_REF:15}" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@32aa5b4c155d76c94e4ec883a223c947b2f02656 # v2.2.3
with:
path: CHANGELOG.md
- name: Create Release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: git2mail-${{ steps.get_version.outputs.VERSION }}
release_name: git2mail-${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: true
- name: Download Linux artifact
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
path: git2mail-linux
pattern: git2mail-*
merge-multiple: true
- name: Download Windows artifact
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
path: git2mail-windows
pattern: git2mail-*
merge-multiple: true
- name: Download MacOS artifact
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
path: git2mail-macos
pattern: git2mail-*
merge-multiple: true
- name: Release Linux artifact
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./git2mail-linux/git2mail
asset_content_type: application/octet-stream
asset_name: git2mail-linux-static-${{ steps.get_version.outputs.VERSION }}
- name: Release Windows artifact
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./git2mail-windows/git2mail.exe
asset_content_type: application/octet-stream
asset_name: git2mail-windows-${{ steps.get_version.outputs.VERSION }}
- name: Release MacOS artifact
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./git2mail-macos/git2mail
asset_content_type: application/octet-stream
asset_name: git2mail-macos-${{ steps.get_version.outputs.VERSION }}