-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (34 loc) · 1.23 KB
/
on-commit.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
name: Create dev build
on:
push:
branches:
- dev
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.20.4"
- name: Build and package resetti for debian
run: make deb
- name: Build and package resetti for redhat distros
run: make rpm
- name: Get rpm file name
id: rpm-filename
run: echo "::set-output name=filename::$(ls out | grep .rpm)"
- name: Upload artifact
env:
COMMIT: ${{ github.event.head_commit.message }}
WEBHOOK: ${{ secrets.DEV_BUILD_WEBHOOK }}
run: |
export SHA=$(git rev-parse --short HEAD)
export COMMIT_NAME=$(echo "$COMMIT" | head -n 1)
curl -H 'Content-Type: multipart/form-data' -X POST \
-F "payload_json={\"username\": \"updates\", \"content\": \"($SHA) $COMMIT_NAME\"}" \
-F "file1=@out/resetti.deb" \
-F "file2=@out/${{ steps.rpm-filename.outputs.filename }}" \
"$WEBHOOK"