arc-addons/.github/workflows/build.yml
AuxXxilium cb76ba3284 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2024-10-19 15:12:21 +02:00

96 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env ash
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build Addons
on:
workflow_dispatch:
inputs:
version:
description: "version"
required: false
type: string
latest:
description: "latest"
default: true
type: boolean
prerelease:
description: "pre release"
default: false
type: boolean
clean:
description: "clean"
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Clean Old
if: inputs.clean == true
uses: Nats-ji/delete-old-releases@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
keep-count: 10
keep-old-minor-releases: false
- name: Changelog
uses: Bullrich/generate-release-changelog@master
id: Changelog
env:
REPO: ${{ github.repository }}
- name: Init Env
run: |
git config --global user.email "info@auxxxilium.tech"
git config --global user.name "AuxXxilium"
sudo timedatectl set-timezone "Europe/Berlin"
- name: Calculate Version
run: |
# Calculate Version
VERSION=""
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="`date +'%y.%m.%d'`"
fi
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "Version: ${VERSION}"
echo "${VERSION}" >VERSION
echo "VERSION=${VERSION}" >> $GITHUB_ENV
fi
- name: Build Addon Packages
run: |
VERSION="${{ env.VERSION }}"
sed -i "s/version:.*$/version: ${VERSION}/g" */manifest.yml
./compile-addons.sh
zip -9 addons-${{ env.VERSION }}.zip -j *.addon VERSION
- name: Release
if: success() && env.VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
makeLatest: ${{ inputs.latest }}
prerelease: ${{ inputs.prerelease }}
allowUpdates: true
body: |
${{ steps.Changelog.outputs.changelog }}
artifacts: |
addons-*.zip
*.addon