-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (105 loc) · 3.78 KB
/
build-release-artifacts-and-draft-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
name: Build Release Artifacts and Draft Release
on:
push:
tags:
- "*.*.*"
permissions:
contents: read
jobs:
build-linux-binary:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build chatsh
run: cargo build --release --verbose
- name: Upload to Artifact
uses: actions/upload-artifact@v3
with:
name: chatsh-linux
path: target/release/chatsh
build-darwin-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build chatsh
run: cargo build --release --verbose
- name: Upload to Artifact
uses: actions/upload-artifact@v3
with:
name: chatsh-darwin
path: target/release/chatsh
draft-release:
needs: [build-linux-binary, build-darwin-binary]
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
name: Draft Release
id: create-draft-release
with:
config-name: workflows-config/release-drafter.yml
disable-autolabeler: true
tag: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Make Directories
run: |
mkdir -p target/release/linux
mkdir -p target/release/darwin
- name: Download Linux Artifact
uses: actions/download-artifact@v2
with:
name: chatsh-linux
path: target/release/linux
- name: Download Darwin Artifact
uses: actions/download-artifact@v2
with:
name: chatsh-darwin
path: target/release/darwin
- name: Archive Linux Artifact
run: tar -czvf target/release/chatsh-linux_x86_64.tar.gz -C target/release/linux chatsh
- name: Archive Darwin Artifact
run: tar -czvf target/release/chatsh-darwin_x86_64.tar.gz -C target/release/darwin chatsh
- name: Calculate Checksums
run: |
cd target/release
sha256sum chatsh-linux_x86_64.tar.gz > chatsh-linux_x86_64.tar.gz.sha256
sha256sum chatsh-darwin_x86_64.tar.gz > chatsh-darwin_x86_64.tar.gz.sha256
- name: Upload Linux Release Artifacts
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create-draft-release.outputs.upload_url }}
asset_path: target/release/chatsh-linux_x86_64.tar.gz
asset_name: chatsh-linux_x86_64.tar.gz
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Linux Release Checksums
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create-draft-release.outputs.upload_url }}
asset_path: target/release/chatsh-linux_x86_64.tar.gz.sha256
asset_name: chatsh-linux_x86_64.tar.gz.sha256
asset_content_type: text/plain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Darwin Release Artifacts
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create-draft-release.outputs.upload_url }}
asset_path: target/release/chatsh-darwin_x86_64.tar.gz
asset_name: chatsh-darwin_x86_64.tar.gz
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Darwin Release Checksums
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create-draft-release.outputs.upload_url }}
asset_path: target/release/chatsh-darwin_x86_64.tar.gz.sha256
asset_name: chatsh-darwin_x86_64.tar.gz.sha256
asset_content_type: text/plain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}