19 Commits

Author SHA1 Message Date
2d2047f0b9 fix: Fixing CI. Set (package) repo name variable 👷🔥
All checks were successful
CI / release (push) Successful in 12s
Create Distribution / Create Archive (push) Successful in 1m33s
2024-10-30 09:53:24 +13:00
443f5eefa9 fix: Fixing CI. Use tag ref from ENV 👷🔥
All checks were successful
CI / release (push) Successful in 14s
Create Distribution / Create Archive (push) Successful in 1m32s
2024-10-30 09:38:47 +13:00
fe8fac0e07 fix: Fixing CI. Use tag ref from ENV 👷🔥
Some checks failed
CI / release (push) Successful in 14s
Create Distribution / Create Archive (push) Failing after 1m32s
2024-10-30 09:31:40 +13:00
fe7e429568 fix: Fixing CI. Update variables 👷🔥
Some checks failed
CI / release (push) Successful in 15s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-30 09:29:50 +13:00
f7e5bf4cd9 fix: Fixing CI. Update variables 👷🔥
Some checks failed
CI / release (push) Successful in 15s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-30 09:25:58 +13:00
1b69a901d9 fix: Fixing CI. Update variables 👷🔥
Some checks failed
CI / release (push) Successful in 13s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-30 09:23:00 +13:00
ee889a3841 fix: Fixing CI. List build dir too 👷🔥
Some checks failed
CI / release (push) Successful in 17s
Create Distribution / Create Archive (push) Failing after 5s
2024-10-29 23:33:58 +13:00
4400bff0b4 fix: Fixing CI. Use master branch 👷🔥
Some checks failed
CI / release (push) Successful in 20s
Create Distribution / Create Archive (push) Failing after 1m30s
2024-10-29 22:07:41 +13:00
8b9534bc91 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:40:11 +13:00
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
7657af0a55 fix: Updated build script 🔨💚
All checks were successful
CI / release (push) Successful in 19s
2024-10-24 16:55:02 +13:00
8 changed files with 69 additions and 51 deletions

View File

@@ -4,29 +4,13 @@ on:
branches: branches:
- "**" - "**"
tags: tags:
- " !**" - "!**"
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - 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 - name: Create Release Archive
id: semrelease id: semrelease
uses: go-semantic-release/action@v1 uses: go-semantic-release/action@v1
@@ -36,6 +20,4 @@ jobs:
env: env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }} GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}} GITEA_HOST: ${{ secrets.G_SERVER_URL}}
env:
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
GITEA_HOST: ${{ secrets.G_SERVER_URL}}

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

@@ -0,0 +1,27 @@
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
ls -lah build/
- uses: https://hub.cybercinch.nz/guisea/gitea-composer-upload-action@master
with:
baseurl: "${{ secrets.G_SERVER_URL}}"
access_token: "${{ secrets.G_TOKEN }}"
username: "${{ secrets.G_USERNAME }}"
owner: "cybercinch" # Override owner name for repository (Optional) Only if different from username
repo_name: ugly-queue
version: "${{ env.GITHUB_REF_NAME }}"
overwrite_files: "true"

View File

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

View File

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

View File

@@ -1,24 +1,32 @@
#!/bin/bash #!/bin/bash
mkdir -p ./build/tmp mkdir -p ./build/
echo "Made temporary directory" echo "Made temporary directory"
# Package up the release # Package up the release (Needs to be .zip for upload to gitea)
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)
# Attach to release zip -r "./build/Package.zip" \
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}" \ -x '.semrel/*' \
--form attachment="@build/ugly-queue-${1}.tar.gz" -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 # Upload the artifact to composer registry
curl -H "Authorization: token ${GITEA_TOKEN}" \ curl --user "cibot:${GITEA_TOKEN}" \
--upload-file "build/ugly-queue-${1}.tar.gz" \ --upload-file "build/ugly-queue.zip" \
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}" "${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"

View File

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

View File

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

View File

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