9 Commits

Author SHA1 Message Date
a6ecf19932 fix: Fixing CI. Added directory listing 👷🔥
Some checks failed
CI / release (push) Successful in 13s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-29 21:37:39 +13:00
942c4e8699 fix: Fixing CI. Separate flow for upload 👷🔥
Some checks failed
CI / release (push) Successful in 14s
Create Distribution / Create Archive (push) Failing after 4s
2024-10-29 21:31:10 +13:00
d9d01fcbb3 fix: Fixing CI. Separate flow for upload 👷🔥
Some checks failed
CI / release (push) Successful in 1m47s
Create Distribution / Create Archive (push) Failing after 2s
2024-10-29 21:10:53 +13:00
de1973025f fix: Exclude generated changelog 🔥
All checks were successful
CI / release (push) Successful in 16s
2024-10-24 23:03:56 +13:00
dede25ec32 fix: Do not include semrel folder 🔥
All checks were successful
CI / release (push) Successful in 16s
2024-10-24 22:59:47 +13:00
607d3a9004 fix: Relabelling namespace/package names ♻️
All checks were successful
CI / release (push) Successful in 24s
2024-10-24 22:38:37 +13:00
032be45f9f fix: Create .zip archive instead of .tar.gz for Gitea 💚👷
All checks were successful
CI / release (push) Successful in 42s
2024-10-24 22:25:21 +13:00
afbddabea2 chore: Updated repo path 🔨 2024-10-24 22:24:23 +13:00
2ec085419f fix: Updated build script 🔨💚
All checks were successful
CI / release (push) Successful in 22s
2024-10-24 16:58:31 +13:00
8 changed files with 65 additions and 51 deletions

View File

@@ -4,29 +4,13 @@ on:
branches:
- "**"
tags:
- " !**"
- "!**"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
# - name: Install gitea provider for Go Semantic Release
# run: |
# mkdir -p .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/ && \
# wget https://github.com/cybercinch/go-semantic-release-provider-gitea/releases/download/v${GITEA_PROVIDER_VER}/go-semantic-release-provider-gitea_v${GITEA_PROVIDER_VER}_linux_amd64 \
# -O .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/gitea && \
# chmod a+x .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/gitea
# env:
# GITEA_PROVIDER_VER: 1.0.11
# - uses: "shivammathur/setup-php@v2"
# with:
# php-version: "7.4"
# - uses: "ramsey/composer-install@v3"
- name: Create Release Archive
id: semrelease
uses: go-semantic-release/action@v1
@@ -36,6 +20,4 @@ jobs:
env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}}
env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}}

24
.github/workflows/dist.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Create Distribution
run-name: Distribute composer package with Gitea Actions 🚀
on:
push:
tags:
- 'v*'
jobs:
dist:
name: Create Archive
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # Checkout Sourcecode
- uses: https://hub.cybercinch.nz/cybercinch/composer-build-action@v1
- run: |
ls -lah
- uses: https://hub.cybercinch.nz/guisea/gitea-composer-upload-action@v1
with:
base_url: "${{ secrets.G_SERVER_URL}}"
access_token: "${{ secrets.G_TOKEN }}"
username: "${{ secrets.G_USERNAME }}"
owner: "cybercinch" # Override owner name for repository (Optional)
package_version: "${{ env.GITHUB_REF_NAME }}"

View File

@@ -14,7 +14,6 @@
"exec"
],
"options": {
"exec_on_success": "./scripts/build.sh v{{.NewRelease.Version}}",
"exec_on_no_release": "echo {{.Reason}}: {{.Message}}"
}
}

View File

@@ -9,7 +9,7 @@
"file queue",
"ugly queue"
],
"homepage": "https://github.com/dcarbone/ugly-queue",
"homepage": "https://hub.cybercinch.nz/cybercinch/ugly-queue",
"license": "GPLv3",
"authors" : [

View File

@@ -1,25 +1,32 @@
#!/bin/bash
mkdir -p ./build/tmp
mkdir -p ./build/
echo "Made temporary directory"
# Package up the release
tar -czf "./build/ugly-queue-${1}.tar.gz" \
--exclude='./vendor' \
--exclude='./tests' \
--exclude='./build' \
.
RELEASE_ID=$(curl --silent -X 'GET' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/latest" \
-H "accept: application/json" \
-H "Authorization: token ${GITEA_TOKEN}" | jq -r .id)
# Package up the release (Needs to be .zip for upload to gitea)
# Attach to release
curl --silent -X 'POST' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/${RELEASE_ID}/assets?name=ugly-queue-${1}.tar.gz" \
-H "Authorization: token ${GITEA_TOKEN}" \
--form attachment="@build/ugly-queue-${1}.tar.gz"
zip -r "./build/Package.zip" \
. \
-x '.semrel/*' \
-x '.generated-go-semantic-release-changelog.md' \
-x './vendor/*' \
-x './tests/*' \
-x './build/*' \
-x './.git/*' \
-x './.idea/*' \
-x './.github/*' \
-x './scripts/*'
#RELEASE_ID=$(curl --silent -X 'GET' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/latest" \
#-H "accept: application/json" \
#-H "Authorization: token ${GITEA_TOKEN}" | jq -r .id)
#
## Attach to release
#curl --silent -X 'POST' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/${RELEASE_ID}/assets?name=ugly-queue-${1}.tar.gz" \
#-H "Authorization: token ${GITEA_TOKEN}" \
#--form attachment="@build/ugly-queue-${1}.tar.gz"
# Upload the artifact to composer registry
curl --user cibot:${GITEA_TOKEN} \
--upload-file "build/ugly-queue-${1}.tar.gz" \
curl --user "cibot:${GITEA_TOKEN}" \
--upload-file "build/ugly-queue.zip" \
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"

View File

@@ -4,7 +4,7 @@ use DCarbone\Helpers\FileHelper;
/**
* Class UglyQueue
* @package DCarbone
* @package Cybercinch
*/
class UglyQueue implements \Serializable, \SplSubject, \Countable
{

View File

@@ -2,7 +2,7 @@
/**
* Class UglyQueueEnum
* @package DCarbone
* @package Cybercinch
*
* Pseudo-enum thing.
*/

View File

@@ -1,8 +1,10 @@
<?php namespace Cybercinch;
use InvalidArgumentException;
/**
* Class UglyQueueManager
* @package DCarbone
* @package Cybercinch
*/
class UglyQueueManager implements \SplObserver, \Countable
{
@@ -17,12 +19,12 @@ class UglyQueueManager implements \SplObserver, \Countable
*
* @param string $baseDir
* @throws \RuntimeException
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function __construct($baseDir)
{
if (false === is_string($baseDir))
throw new \InvalidArgumentException('Argument 1 expected to be string, "'.gettype($baseDir).'" seen.');
throw new InvalidArgumentException('Argument 1 expected to be string, "'.gettype($baseDir).'" seen.');
if (false === is_dir($baseDir))
throw new \RuntimeException('"'.$baseDir.'" points to a directory that does not exist.');
@@ -40,7 +42,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param string $name
* @return UglyQueue|UglyQueueManager
* @return UglyQueue
*/
public function getQueue($name)
{
@@ -56,7 +58,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param UglyQueue $uglyQueue
* @return \DCarbone\UglyQueueManager
* @return UglyQueueManager
* @throws \RuntimeException
*/
public function addQueue(UglyQueue $uglyQueue)
@@ -111,7 +113,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param UglyQueue $uglyQueue
* @return \DCarbone\UglyQueueManager
* @return UglyQueueManager
*/
public function removeQueue(UglyQueue $uglyQueue)
{
@@ -124,7 +126,7 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param string $name
* @return \DCarbone\UglyQueueManager
* @return UglyQueueManager
*/
public function removeQueueByName($name)
{
@@ -136,15 +138,15 @@ class UglyQueueManager implements \SplObserver, \Countable
/**
* @param string $name
* @return \DCarbone\UglyQueue
* @throws \InvalidArgumentException
* @return UglyQueue
* @throws InvalidArgumentException
*/
public function getQueueWithName($name)
{
if (isset($this->queues[$name]))
return $this->queues[$name];
throw new \InvalidArgumentException('Argument 1 expected to be valid queue name.');
throw new InvalidArgumentException('Argument 1 expected to be valid queue name.');
}
/**