Skip to content

Xodium CI/CD

Xodium CI/CD #73

Workflow file for this run

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
if: github.event_name == 'workflow_dispatch'
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 }}