You've already forked ugly-queue
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 80219635ad | |||
| 2d2047f0b9 | |||
| 443f5eefa9 | |||
| fe8fac0e07 | |||
| fe7e429568 | |||
| f7e5bf4cd9 | |||
| 1b69a901d9 | |||
| ee889a3841 | |||
| 4400bff0b4 | |||
| 8b9534bc91 | |||
| a6ecf19932 | |||
| 942c4e8699 | |||
| d9d01fcbb3 | |||
| de1973025f | |||
| dede25ec32 | |||
| 607d3a9004 |
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@@ -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}}
|
||||
|
||||
|
||||
22
.github/workflows/dist.yml
vendored
Normal file
22
.github/workflows/dist.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
- 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
|
||||
version: "${{ env.GITHUB_REF_NAME }}"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
"exec"
|
||||
],
|
||||
"options": {
|
||||
"exec_on_success": "./scripts/build.sh v{{.NewRelease.Version}}",
|
||||
"exec_on_no_release": "echo {{.Reason}}: {{.Message}}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,10 @@ echo "Made temporary directory"
|
||||
|
||||
# Package up the release (Needs to be .zip for upload to gitea)
|
||||
|
||||
zip -r "./build/ugly-queue.zip" \
|
||||
zip -r "./build/Package.zip" \
|
||||
. \
|
||||
-x '.semrel/*' \
|
||||
-x '.generated-go-semantic-release-changelog.md' \
|
||||
-x './vendor/*' \
|
||||
-x './tests/*' \
|
||||
-x './build/*' \
|
||||
@@ -15,14 +17,14 @@ zip -r "./build/ugly-queue.zip" \
|
||||
-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"
|
||||
#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}" \
|
||||
|
||||
@@ -4,7 +4,7 @@ use DCarbone\Helpers\FileHelper;
|
||||
|
||||
/**
|
||||
* Class UglyQueue
|
||||
* @package DCarbone
|
||||
* @package Cybercinch
|
||||
*/
|
||||
class UglyQueue implements \Serializable, \SplSubject, \Countable
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* Class UglyQueueEnum
|
||||
* @package DCarbone
|
||||
* @package Cybercinch
|
||||
*
|
||||
* Pseudo-enum thing.
|
||||
*/
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user