-
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.92 KB
/
ci_cd.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
name: Xodium CI/CD
run-name: "Xodium CI/CD"
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Release
runs-on: [ubuntu-latest]
environment:
name: ${{ github.ref_name }}
url: ${{ steps.create_release.outputs.url }}
outputs:
VERSION: ${{ steps.get_version.outputs.VERSION }}
SHA1: ${{ steps.calculate_sha1.outputs.SHA1 }}
steps:
- id: checkout
name: Checkout
uses: actions/checkout@main
- id: get_version
name: Get Version
run: echo "VERSION=$(jq -r '.version' version.json)" >> $GITHUB_OUTPUT
- id: create_zip
name: Create Zip File
run: |
mkdir -p temp
cd illyriarp
zip -r "../temp/IllyriaRP_${{ steps.get_version.outputs.VERSION }}.zip" assets pack.mcmeta pack.png
- id: calculate_sha1
name: Calculate SHA1
run: echo "SHA1=$(sha1sum "temp/IllyriaRP_${{ steps.get_version.outputs.VERSION }}.zip" | awk '{ print $1 }')" >> $GITHUB_OUTPUT
- id: create_release
name: Create Release
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: ${{ contains(github.event.head_commit.message, '.draft') }}
files: temp/IllyriaRP_${{ steps.get_version.outputs.VERSION }}.zip
body: |
Direct Download Link: https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/IllyriaRP_${{ steps.get_version.outputs.VERSION }}.zip
SHA-1 Hash: ${{ steps.calculate_sha1.outputs.SHA1 }}
generate_release_notes: true
prerelease: ${{ contains(github.event.head_commit.message, '.pre') }}
tag_name: ${{ steps.get_version.outputs.VERSION }}