Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.ssf-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v2.5.1
_commit: v2.7.3
_src_path: https://github.com/dafyddj/copier-ssf-ci
failure_permitted_ignored: []
failure_permitted_patterns:
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ jobs:
name: Lint / `pre-commit`
needs: should-run
if: fromJSON(needs.should-run.outputs.should-run)
container: techneg/ci-pre-commit:v2.4.31@sha256:041f7d716f4cde881e547881e6cc771d499ff424d0afb7ec678176ff0b940d0a
container: techneg/ci-pre-commit:v2.5.2@sha256:af1cccdd8afe64bbeac5216e3c243e2c3f716f665edf8487a9e920cbfb85c1fb
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 10
steps:
- run: | # Needed because of bug #2031 in `actions/checkout`
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
fetch-tags: true
filter: tree:0
- name: Export `CI_CACHE_ID` from container
run: echo "CI_CACHE_ID=$(cat /.ci_cache_id)" >> $GITHUB_ENV
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ~/.cache/pre-commit
key: "${{ env.CI_CACHE_ID }}|\
Expand All @@ -58,15 +58,28 @@ jobs:
results:
name: Release / Collect results
permissions:
contents: write
issues: write
pull-requests: write
checks: read
container: techneg/ci-semantic-release:v1.2.1@sha256:d23338a31ae979a4d15b9b4c68c3dea0795210956d2c43dc6eab1791483b7607
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- run: | # Needed due to bug actions/checkout#2031
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# yamllint disable-line rule:line-length
- uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0
with:
ignore: >
Release / Collect results
ignore_pattern: ^GitLab CI
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run `semantic-release`
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAINTAINER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
semantic-release --dry-run
- run: echo "::notice ::Workflow success!"
24 changes: 6 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
stage_test: &stage_test 'test'
# `image`
# yamllint disable rule:line-length
image_commitlint: &image_commitlint 'techneg/ci-commitlint:v1.1.97@sha256:7eaa2170f49cf9a8f2acd11a9fc35d4ec93c514935c6b76f7df8a39f9d2afb45'
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.66@sha256:5a915fcebd0c32f54b4effcf1aa58ce03f78fc8e8b95e706183ec57c24c9337c'
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.66@sha256:5a915fcebd0c32f54b4effcf1aa58ce03f78fc8e8b95e706183ec57c24c9337c'
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.4.31@sha256:041f7d716f4cde881e547881e6cc771d499ff424d0afb7ec678176ff0b940d0a'
image_commitlint: &image_commitlint 'techneg/ci-commitlint:v1.1.100@sha256:cdcfb678d97a38dc1bdb7010935e5e7e6515131812c76c32a78307860bf8193e'
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.69@sha256:73b50339c27f37232edd5442ed02578dcca653bbac3c7335f6ccd576b5bbadf3'
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.69@sha256:73b50339c27f37232edd5442ed02578dcca653bbac3c7335f6ccd576b5bbadf3'
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.5.2@sha256:af1cccdd8afe64bbeac5216e3c243e2c3f716f665edf8487a9e920cbfb85c1fb'
image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest@sha256:fe69f9642c7edde46bbd78326d2c42c6e13fc73694efb142e92e206725479328'
image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14@sha256:374f588420087517a3cc0235e11293bffd72d7a59da3d98d5e69f014ff2a7761'
image_semantic-release: &image_semanticrelease 'techneg/ci-semantic-release:v1.2.1@sha256:d23338a31ae979a4d15b9b4c68c3dea0795210956d2c43dc6eab1791483b7607'
# `services`
services_docker_dind: &services_docker_dind
- 'docker:28.3.2-dind@sha256:5415fccf3da3aed821efb2258cb7dcf52fb9bb0627b02d45338e887c352c4bce'
- 'docker:28.3.3-dind@sha256:c0872aae4791ff427e6eda52769afa04f17b5cf756f8267e0d52774c99d5c9de'
# yamllint enable rule:line-length
# `variables`
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
Expand Down Expand Up @@ -94,15 +94,6 @@ commitlint:
# Set default commit hashes for `--from` and `--to`
- 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
- 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
# `coqbot` adds a merge commit to test PRs on top of the latest commit in
# the repo; amend this merge commit message to avoid failure
- |
if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
&& [ "${CI_COMMIT_BRANCH}" != "master" ]; then
git commit --amend -m \
'chore: reword coqbot merge commit message for commitlint'
export COMMITLINT_TO=HEAD
fi
# Run `commitlint`
- 'commitlint --from "${COMMITLINT_FROM}"
--to "${COMMITLINT_TO}"
Expand Down Expand Up @@ -226,13 +217,10 @@ ubuntu-2004-3006-14: {extends: '.test_instance'}
# `release` stage: `semantic-release`
###############################################################################
semantic-release:
only: *only_branch_master_parent_repo
stage: *stage_release
image: *image_semanticrelease
variables:
MAINTAINER_TOKEN: '${GH_TOKEN}'
script:
# Update `AUTHORS.md`
- '${HOME}/go/bin/maintainer contributor'
# Run `semantic-release`
- 'semantic-release'
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ci:
default_stages: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-merge-conflict
name: Check for Git merge conflicts
Expand All @@ -30,7 +30,7 @@ repos:
- id: commitlint
- id: commitlint-ci
- repo: https://github.com/rubocop-hq/rubocop
rev: v1.78.0
rev: v1.79.2
hooks:
- id: rubocop
name: Check Ruby files with rubocop
Expand Down Expand Up @@ -100,7 +100,7 @@ repos:
)$
additional_dependencies: [pygments==2.16.1]
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 41.42.2
rev: 41.63.0
hooks:
- id: renovate-config-validator
name: Check Renovate config with renovate-config-validator
Expand Down
13 changes: 9 additions & 4 deletions pre-commit_semantic-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,25 @@
###############################################################################
# (A) Update `FORMULA` with `${nextRelease.version}`
###############################################################################

sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA


###############################################################################
# (B) Use `m2r2` to convert automatically produced `.md` docs to `.rst`
# (B) Update `AUTHORS.md`
###############################################################################

# Install `m2r2`
pip3 install m2r2
maintainer contributor \
--ignore-contributors dependabot[bot],renovate[bot],semantic-release-bot

###############################################################################
# (C) Use `m2r` to convert automatically produced `.md` docs to `.rst`
###############################################################################

# Copy and then convert the `.md` docs
cp ./*.md docs/
cd docs/ || exit
m2r2 --overwrite ./*.md
m2r --overwrite ./*.md

# Change excess `H1` headings to `H2` in converted `CHANGELOG.rst`
sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst
Expand Down
86 changes: 2 additions & 84 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
branch: 'master',
// TODO: remove this when we no longer process releases on GitLab CI
repositoryUrl: 'https://github.com/saltstack-formulas/syslog-ng-formula',
plugins: [
['@semantic-release/commit-analyzer', {
Expand All @@ -21,88 +21,6 @@ module.exports = {
'@semantic-release/github'
],
generateNotes: {
preset: 'angular',
writerOpts: {
// Required due to upstream bug preventing all types being displayed.
// Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
// Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
transform: (commit, context) => {
const issues = []

commit.notes.forEach(note => {
note.title = 'BREAKING CHANGES'
})

// NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
if (commit.type === 'feat') {
commit.type = 'Features'
} else if (commit.type === 'fix') {
commit.type = 'Bug Fixes'
} else if (commit.type === 'perf') {
commit.type = 'Performance Improvements'
} else if (commit.type === 'revert') {
commit.type = 'Reverts'
} else if (commit.type === 'docs') {
commit.type = 'Documentation'
} else if (commit.type === 'style') {
commit.type = 'Styles'
} else if (commit.type === 'refactor') {
commit.type = 'Code Refactoring'
} else if (commit.type === 'test') {
commit.type = 'Tests'
} else if (commit.type === 'build') {
commit.type = 'Build System'
// } else if (commit.type === `chore`) {
// commit.type = `Maintenance`
} else if (commit.type === 'ci') {
commit.type = 'Continuous Integration'
} else {
return
}

if (commit.scope === '*') {
commit.scope = ''
}

if (typeof commit.hash === 'string') {
commit.shortHash = commit.hash.substring(0, 7)
}

if (typeof commit.subject === 'string') {
let url = context.repository
? `${context.host}/${context.owner}/${context.repository}`
: context.repoUrl
if (url) {
url = `${url}/issues/`
// Issue URLs.
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
issues.push(issue)
return `[#${issue}](${url}${issue})`
})
}
if (context.host) {
// User URLs.
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
if (username.includes('/')) {
return `@${username}`
}

return `[@${username}](${context.host}/${username})`
})
}
}

// remove references that already appear in the subject
commit.references = commit.references.filter(reference => {
if (issues.indexOf(reference.issue) === -1) {
return true
}

return false
})

return commit
}
}
preset: 'angular'
}
}
Loading