forked from BeamMP/BeamMP
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.53 KB
/
release.yml
File metadata and controls
43 lines (39 loc) · 1.53 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
name: Create Release Zip and SHA-256
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the code
if: ${{ github.event.release.prerelease == false }}
uses: actions/checkout@v4
with:
ref: 'public'
- name: Check out the code (beta)
if: ${{ github.event.release.prerelease == true }}
uses: actions/checkout@v4
with:
ref: 'beta'
- name: Zip specific files and folders
run: |
zip -r BeamMP.zip icons lua mp_locales scripts settings ui vehicles CONTRIBUTING.md CODE_OF_CONDUCT.md LICENSE.md README.md NOTICES.md
working-directory: ${{ github.workspace }}
- name: Generate SHA-256 hash
id: sha256
run: |
sha256sum BeamMP.zip | awk '{print $1}' > BeamMP.zip.sha256
working-directory: ${{ github.workspace }}
- name: Upload artifacts
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/zip" \
--data-binary "@BeamMP.zip" \
--url "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=BeamMP.zip"
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: text/plain" \
--data-binary "@BeamMP.zip.sha256" \
--url "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=BeamMP.zip.sha256"
working-directory: ${{ github.workspace }}