This commit is contained in:
Wryn (yage) Wagner 2024-04-14 01:03:13 -06:00
parent 897d2c8040
commit ec6c7d9826

View File

@ -27,6 +27,8 @@ commands:
archlinux-run: archlinux-run:
description: execute command steps in the archlinux container from the CI user description: execute command steps in the archlinux container from the CI user
parameters: parameters:
_name:
type: string
command: command:
type: string type: string
working_directory: working_directory:
@ -34,21 +36,11 @@ commands:
default: /home/ci default: /home/ci
steps: steps:
- run: - run:
name: << parameters._name >>
working_directory: << parameters.working_directory >> working_directory: << parameters.working_directory >>
command: su ci -c '<< parameters.command >>' command: su ci -c '<< parameters.command >>'
custom: custom:
generic:
require-semver-tag:
- &generic_require_semver_tag
run:
name: check CIRCLE_TAG for full semantic version
command: |
: \
&& [ $CIRCLE_TAG ] \
&& [[ $CIRCLE_TAG =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] \
;
archlinux: archlinux:
prepare: prepare:
- &archlinux_prepare - &archlinux_prepare
@ -62,11 +54,13 @@ custom:
clone-aur: clone-aur:
- &archlinux_clone_aur - &archlinux_clone_aur
archlinux-run: archlinux-run:
_name: clone aur/scwrypts
command: git clone https://aur.archlinux.org/scwrypts.git aur command: git clone https://aur.archlinux.org/scwrypts.git aur
clone-scwrypts: clone-scwrypts:
- &archlinux_clone_scwrypts - &archlinux_clone_scwrypts
run: run:
_name: clone wrynegade/scwrypts
working_directory: /home/ci working_directory: /home/ci
command: | command: |
GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" git clone -b "yage/circle-ci/aur-automation" "$CIRCLE_REPOSITORY_URL" scwrypts GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" git clone -b "yage/circle-ci/aur-automation" "$CIRCLE_REPOSITORY_URL" scwrypts
@ -74,6 +68,17 @@ custom:
#command: git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" scwrypts #command: git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" scwrypts
jobs: jobs:
require-full-semver:
executor: nodejs
steps:
- run:
name: check CIRCLE_TAG for full semantic version
command: |
: \
&& [ $CIRCLE_TAG ] \
&& [[ $CIRCLE_TAG =~ ^v[0-9]*.[0-9]*.[0-9]*$ ]] \
;
aur-test: aur-test:
executor: archlinux executor: archlinux
steps: steps:
@ -81,6 +86,7 @@ jobs:
- *archlinux_clone_aur - *archlinux_clone_aur
- *archlinux_clone_scwrypts - *archlinux_clone_scwrypts
- archlinux-run: - archlinux-run:
name: test aur build on current source
working_directory: /home/ci/aur working_directory: /home/ci/aur
command: >- command: >-
: :
@ -101,7 +107,6 @@ jobs:
aur-publish: aur-publish:
executor: archlinux executor: archlinux
steps: steps:
- *generic_require_semver_tag
- *archlinux_prepare - *archlinux_prepare
- *archlinux_clone_aur - *archlinux_clone_aur
- archlinux-run: - archlinux-run:
@ -222,59 +227,47 @@ jobs:
- run: pip install build && python -m build - run: pip install build && python -m build
- run: pip install twine && twine upload dist/* - run: pip install twine && twine upload dist/*
workflows: workflows:
aur-dev: dev:
jobs: jobs:
- aur-test: - aur-test:
context: [aur-yage]
#- python-test: *dev_filters
- python-test:
&dev_filters
filters: filters:
branches: branches:
ignore: /^main$/ ignore: /^main$/
- nodejs-test: *dev_filters
publish:
python-dev:
jobs: jobs:
- python-test: - require-full-semver:
filters:
branches:
ignore: /^main$/
python:
jobs:
- python-test:
filters: filters:
tags: tags:
only: /^v\d+\.\d+\.\d+.*$/ only: /^v\d+\.\d+\.\d+.*$/
branches: branches:
ignore: /^.*$/ ignore: /^.*$/
- aur-test:
requires: [require_full_semver]
- aur-publish:
context: [aur-yage]
requires:
- aur-test
- python-publish
- nodejs-publish
- python-test:
requires: [require_full_semver]
- python-publish: - python-publish:
requires: [python-test] requires:
context: [pypi-yage] - python-test
filters:
tags:
only: /^v\d+\.\d+\.\d+.*$/
branches:
ignore: /^.*$/
nodejs-dev:
jobs:
- nodejs-test: - nodejs-test:
filters: requires: [require_full_semver]
branches:
ignore: /^main$/
nodejs:
jobs:
- nodejs-test:
filters:
tags:
only: /^v\d+\.\d+\.\d+.*$/
branches:
ignore: /^.*$/
- nodejs-publish: - nodejs-publish:
requires: [nodejs-test] requires:
context: [npm-wrynegade] - nodejs-test
filters:
tags:
only: /^v\d+\.\d+\.\d+.*$/
branches:
ignore: /^.*$/