You've already forked ugly-queue
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6ecf19932 | |||
| 942c4e8699 | |||
| d9d01fcbb3 | |||
| de1973025f | |||
| dede25ec32 | |||
| 607d3a9004 | |||
| 032be45f9f | |||
| afbddabea2 | |||
| 2ec085419f |
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@@ -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}}
|
|
||||||
|
|||||||
24
.github/workflows/dist.yml
vendored
Normal file
24
.github/workflows/dist.yml
vendored
Normal 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 }}"
|
||||||
|
|
||||||
@@ -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}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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" : [
|
||||||
|
|||||||
@@ -1,25 +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 --user "cibot:${GITEA_TOKEN}" \
|
||||||
curl --user cibot:${GITEA_TOKEN} \
|
--upload-file "build/ugly-queue.zip" \
|
||||||
--upload-file "build/ugly-queue-${1}.tar.gz" \
|
|
||||||
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"
|
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UglyQueueEnum
|
* Class UglyQueueEnum
|
||||||
* @package DCarbone
|
* @package Cybercinch
|
||||||
*
|
*
|
||||||
* Pseudo-enum thing.
|
* Pseudo-enum thing.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user