Updating clear script release
All checks were successful
Rebase Remote Branches / rebase-branches (push) Successful in 3s
All checks were successful
Rebase Remote Branches / rebase-branches (push) Successful in 3s
This commit is contained in:
21
.gitea/workflows/auto-rebase.yml
Normal file
21
.gitea/workflows/auto-rebase.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: Rebase Remote Branches
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
# Disable multiple workflows at the same time
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.head_ref || github.ref_name }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
rebase-branches:
|
||||||
|
runs-on: skydust-runner
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Rebase
|
||||||
|
uses: https://gitea.skydust.fr/actions/auto-rebase@main
|
||||||
64
.gitea/workflows/production.yml
Normal file
64
.gitea/workflows/production.yml
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# This defines the name of the workflow as it will appear in the "Actions" tab of the Gitea repository.
|
||||||
|
name: Production deployment
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
HOMEBREW_REPO: "git@gitea.skydust.fr:Skydust/homebrew-clearscript.git"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker:
|
||||||
|
name: Building and pushing
|
||||||
|
runs-on: skydust-runner
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- name: Check out repo's default branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Getting version
|
||||||
|
uses: https://gitea.skydust.fr/actions/get-version@main
|
||||||
|
- name: Update package version
|
||||||
|
run: |
|
||||||
|
log_info "Updating version in version.sh to $(yellow)$NEW_VERSION"
|
||||||
|
sed -Ei "s|^(Version=\")[^\"]*|\1${NEW_VERSION}|" version.sh
|
||||||
|
cat version.sh
|
||||||
|
- name: TARRRRRRRR and push
|
||||||
|
run: |
|
||||||
|
PACKAGE_NAME="clearscript-v${NEW_VERSION}"
|
||||||
|
log_info "Packaging app into $(yellow)${PACKAGE_NAME}"
|
||||||
|
tar -zcf "${PACKAGE_NAME}.tar.gz" Clear.sh version.sh README.md
|
||||||
|
|
||||||
|
log_info "Sending package"
|
||||||
|
PKG_URL="${GITHUB_SERVER_URL}/api/packages/Skydust/generic/brew-clearscript/${NEW_VERSION}/package.tar.gz"
|
||||||
|
curl --user "MilaBot:${{ secrets.CI_TOKEN }}" \
|
||||||
|
--upload-file "${PACKAGE_NAME}.tar.gz" \
|
||||||
|
"${PKG_URL}"
|
||||||
|
|
||||||
|
echo "PKG_SHA=$(sha256 -q "${PACKAGE_NAME}.tar.gz" | tr -d '\n')" >> $GITEA_ENV
|
||||||
|
echo "PKG_URL=${PKG_URL}" >> $GITEA_ENV
|
||||||
|
- name: Update homebrew repo
|
||||||
|
run: |
|
||||||
|
git config user.email "release@example.com"
|
||||||
|
git config user.name "Release"
|
||||||
|
|
||||||
|
log_info "Overriding git repository auth with PAT"
|
||||||
|
repo_url="$(git remote get-url origin)"
|
||||||
|
repo_url="${repo_url#https://}" # Remove HTTPS
|
||||||
|
GIT_NEW_URL="https://MilaBot:${{ secrets.CI_TOKEN }}@${repo_url}.git"
|
||||||
|
git remote set-url origin "$GIT_NEW_URL"
|
||||||
|
git config --local --unset http.https://${GITHUB_SERVER_URL#https://}/.extraheader
|
||||||
|
|
||||||
|
log_info "Shallow cloning the brew repo $(yellow)${HOMEBREW_REPO}"
|
||||||
|
git clone --depth 1 "${HOMEBREW_REPO}" ./brew_repo/
|
||||||
|
cd brew_repo/
|
||||||
|
|
||||||
|
log_info "Modifying brew version"
|
||||||
|
sed -Ei "s|(url \")[^\"]*|\1${PKG_URL}|" Formula/clearscript.rb
|
||||||
|
sed -Ei "s|(sha256 \")[^\"]*|\1${PKG_SHA}|" Formula/clearscript.rb
|
||||||
|
cat Formula/clearscript.rb
|
||||||
|
|
||||||
|
log_info "Pushing the new version"
|
||||||
|
git add Formula
|
||||||
|
git push
|
||||||
23
.gitea/workflows/release.yml
Normal file
23
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
semver:
|
||||||
|
type: choice
|
||||||
|
description: Choose the semver
|
||||||
|
options:
|
||||||
|
- "Major - Incompatible API changes"
|
||||||
|
- "Minor - Adding functionality in a backward compatible manner"
|
||||||
|
- "Patch - Backward compatible bug fixes"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: skydust-runner
|
||||||
|
steps:
|
||||||
|
- name: Release
|
||||||
|
uses: https://gitea.skydust.fr/actions/create-release@main
|
||||||
|
with:
|
||||||
|
semver: ${{ inputs.semver }}
|
||||||
|
token: ${{ secrets.CI_TOKEN }}
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
14
Clear.sh
14
Clear.sh
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
Version="2.0"
|
source "./version.sh"
|
||||||
|
|
||||||
# ------ COLOR SETUP ------ #
|
# ------ COLOR SETUP ------ #
|
||||||
# Reset
|
# Reset
|
||||||
@@ -79,7 +79,7 @@ addJob() {
|
|||||||
|
|
||||||
jobSteps["$name"]="$step"
|
jobSteps["$name"]="$step"
|
||||||
|
|
||||||
if [[ -z $jobCategories["$category"] ]]; then
|
if [[ -z "${jobCategories["$category"]}" ]]; then
|
||||||
jobCategories["$category"]="$name"
|
jobCategories["$category"]="$name"
|
||||||
else
|
else
|
||||||
jobCategories["$category"]+="\n$name"
|
jobCategories["$category"]+="\n$name"
|
||||||
@@ -177,14 +177,16 @@ runJobs() {
|
|||||||
# Elevate permissions...
|
# Elevate permissions...
|
||||||
asksudo
|
asksudo
|
||||||
|
|
||||||
|
# shellcheck disable=SC2296
|
||||||
for category in ${(k)jobCategories}; do
|
for category in ${(k)jobCategories}; do
|
||||||
echo
|
echo
|
||||||
echo "${BarColor}[ --====-- $CategoryColor$category${BarColor} --====-- ]${Color_Off}"
|
echo "${BarColor}[ --====-- $CategoryColor$category${BarColor} --====-- ]${Color_Off}"
|
||||||
|
|
||||||
echo "$jobCategories[$category]" | while IFS= read -r jobName; do
|
echo "${jobCategories[$category]}" | while IFS= read -r jobName; do
|
||||||
if [[ "${jobEnabled["\"$jobName\""]}" = true ]]; then
|
if [[ "${jobEnabled["\"$jobName\""]}" = true ]]; then
|
||||||
local step=$jobSteps["$jobName"]
|
local step=${jobSteps["$jobName"]}
|
||||||
|
|
||||||
|
# shellcheck disable=SC2296
|
||||||
if print -l ${(ok)functions} | grep -q "^$step$"; then
|
if print -l ${(ok)functions} | grep -q "^$step$"; then
|
||||||
jobTitle "$jobName"
|
jobTitle "$jobName"
|
||||||
# Running the custom job function
|
# Running the custom job function
|
||||||
@@ -207,6 +209,7 @@ read_config_file() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
|
# shellcheck disable=SC2296
|
||||||
parts=(${(s/=/)line})
|
parts=(${(s/=/)line})
|
||||||
|
|
||||||
configKey=${parts[1]}
|
configKey=${parts[1]}
|
||||||
@@ -220,6 +223,7 @@ read_config_file() {
|
|||||||
fi
|
fi
|
||||||
done < $config_filepath
|
done < $config_filepath
|
||||||
|
|
||||||
|
# shellcheck disable=SC2296
|
||||||
for job in ${(k)jobSteps}; do
|
for job in ${(k)jobSteps}; do
|
||||||
# If the job doesn't exist in the config file then it should be added in it
|
# If the job doesn't exist in the config file then it should be added in it
|
||||||
if [[ -z "${jobEnabled["$job"]}" ]]; then
|
if [[ -z "${jobEnabled["$job"]}" ]]; then
|
||||||
@@ -235,6 +239,7 @@ configure() {
|
|||||||
typeset -A optionsToJob
|
typeset -A optionsToJob
|
||||||
|
|
||||||
local all_options=()
|
local all_options=()
|
||||||
|
# shellcheck disable=SC2296
|
||||||
for job in ${(k)jobSteps}; do
|
for job in ${(k)jobSteps}; do
|
||||||
local current_option=""
|
local current_option=""
|
||||||
if [[ "${jobEnabled["$job"]}" = true ]]; then
|
if [[ "${jobEnabled["$job"]}" = true ]]; then
|
||||||
@@ -385,6 +390,7 @@ echo "${BarColor}==========================================${Color_Off}"
|
|||||||
read_config_file
|
read_config_file
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
# shellcheck disable=SC2168
|
||||||
local response
|
local response
|
||||||
|
|
||||||
print -n "Want to configure? (y/N): "
|
print -n "Want to configure? (y/N): "
|
||||||
|
|||||||
3
version.sh
Normal file
3
version.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
Version="2.0"
|
||||||
Reference in New Issue
Block a user