Skip to content

Commit 64d8f1b

Browse files
authored
Merge pull request #42 from saltstack-formulas/renovate/https-github.com-dafyddj-copier-ssf-ci-2.x
chore(copier): update template https://github.com/dafyddj/copier-ssf-ci to v2.7.3
2 parents 7165136 + 29771fc commit 64d8f1b

File tree

6 files changed

+38
-114
lines changed

6 files changed

+38
-114
lines changed

.copier-answers.ssf-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v2.5.1
2+
_commit: v2.7.3
33
_src_path: https://github.com/dafyddj/copier-ssf-ci
44
failure_permitted_ignored: []
55
failure_permitted_patterns:

.github/workflows/main.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ jobs:
2525
name: Lint / `pre-commit`
2626
needs: should-run
2727
if: fromJSON(needs.should-run.outputs.should-run)
28-
container: techneg/ci-pre-commit:v2.4.31@sha256:041f7d716f4cde881e547881e6cc771d499ff424d0afb7ec678176ff0b940d0a
28+
container: techneg/ci-pre-commit:v2.5.2@sha256:af1cccdd8afe64bbeac5216e3c243e2c3f716f665edf8487a9e920cbfb85c1fb
2929
runs-on: ubuntu-latest
30-
timeout-minutes: 5
30+
timeout-minutes: 10
3131
steps:
3232
- run: | # Needed because of bug #2031 in `actions/checkout`
3333
git config --global --add safe.directory "$GITHUB_WORKSPACE"
34-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535
with:
3636
fetch-depth: 0
3737
fetch-tags: true
3838
filter: tree:0
3939
- name: Export `CI_CACHE_ID` from container
4040
run: echo "CI_CACHE_ID=$(cat /.ci_cache_id)" >> $GITHUB_ENV
41-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
41+
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
4242
with:
4343
path: ~/.cache/pre-commit
4444
key: "${{ env.CI_CACHE_ID }}|\
@@ -58,15 +58,28 @@ jobs:
5858
results:
5959
name: Release / Collect results
6060
permissions:
61+
contents: write
62+
issues: write
63+
pull-requests: write
6164
checks: read
65+
container: techneg/ci-semantic-release:v1.2.1@sha256:d23338a31ae979a4d15b9b4c68c3dea0795210956d2c43dc6eab1791483b7607
6266
runs-on: ubuntu-latest
6367
timeout-minutes: 15
6468
steps:
69+
- run: | # Needed due to bug actions/checkout#2031
70+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
71+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6572
# yamllint disable-line rule:line-length
6673
- uses: poseidon/wait-for-status-checks@899c768d191b56eef585c18f8558da19e1f3e707 # v0.6.0
6774
with:
6875
ignore: >
6976
Release / Collect results
7077
ignore_pattern: ^GitLab CI
7178
token: ${{ secrets.GITHUB_TOKEN }}
79+
- name: Run `semantic-release`
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
MAINTAINER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
run: |
84+
semantic-release --dry-run
7285
- run: echo "::notice ::Workflow success!"

.gitlab-ci.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
stage_test: &stage_test 'test'
1616
# `image`
1717
# yamllint disable rule:line-length
18-
image_commitlint: &image_commitlint 'techneg/ci-commitlint:v1.1.97@sha256:7eaa2170f49cf9a8f2acd11a9fc35d4ec93c514935c6b76f7df8a39f9d2afb45'
19-
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.66@sha256:5a915fcebd0c32f54b4effcf1aa58ce03f78fc8e8b95e706183ec57c24c9337c'
20-
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.66@sha256:5a915fcebd0c32f54b4effcf1aa58ce03f78fc8e8b95e706183ec57c24c9337c'
21-
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.4.31@sha256:041f7d716f4cde881e547881e6cc771d499ff424d0afb7ec678176ff0b940d0a'
18+
image_commitlint: &image_commitlint 'techneg/ci-commitlint:v1.1.100@sha256:cdcfb678d97a38dc1bdb7010935e5e7e6515131812c76c32a78307860bf8193e'
19+
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.69@sha256:73b50339c27f37232edd5442ed02578dcca653bbac3c7335f6ccd576b5bbadf3'
20+
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.69@sha256:73b50339c27f37232edd5442ed02578dcca653bbac3c7335f6ccd576b5bbadf3'
21+
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.5.2@sha256:af1cccdd8afe64bbeac5216e3c243e2c3f716f665edf8487a9e920cbfb85c1fb'
2222
image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest@sha256:fe69f9642c7edde46bbd78326d2c42c6e13fc73694efb142e92e206725479328'
23-
image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14@sha256:374f588420087517a3cc0235e11293bffd72d7a59da3d98d5e69f014ff2a7761'
23+
image_semantic-release: &image_semanticrelease 'techneg/ci-semantic-release:v1.2.1@sha256:d23338a31ae979a4d15b9b4c68c3dea0795210956d2c43dc6eab1791483b7607'
2424
# `services`
2525
services_docker_dind: &services_docker_dind
26-
- 'docker:28.3.2-dind@sha256:5415fccf3da3aed821efb2258cb7dcf52fb9bb0627b02d45338e887c352c4bce'
26+
- 'docker:28.3.3-dind@sha256:c0872aae4791ff427e6eda52769afa04f17b5cf756f8267e0d52774c99d5c9de'
2727
# yamllint enable rule:line-length
2828
# `variables`
2929
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
@@ -94,15 +94,6 @@ commitlint:
9494
# Set default commit hashes for `--from` and `--to`
9595
- 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
9696
- 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
97-
# `coqbot` adds a merge commit to test PRs on top of the latest commit in
98-
# the repo; amend this merge commit message to avoid failure
99-
- |
100-
if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
101-
&& [ "${CI_COMMIT_BRANCH}" != "master" ]; then
102-
git commit --amend -m \
103-
'chore: reword coqbot merge commit message for commitlint'
104-
export COMMITLINT_TO=HEAD
105-
fi
10697
# Run `commitlint`
10798
- 'commitlint --from "${COMMITLINT_FROM}"
10899
--to "${COMMITLINT_TO}"
@@ -226,13 +217,10 @@ ubuntu-2004-3006-14: {extends: '.test_instance'}
226217
# `release` stage: `semantic-release`
227218
###############################################################################
228219
semantic-release:
229-
only: *only_branch_master_parent_repo
230220
stage: *stage_release
231221
image: *image_semanticrelease
232222
variables:
233223
MAINTAINER_TOKEN: '${GH_TOKEN}'
234224
script:
235-
# Update `AUTHORS.md`
236-
- '${HOME}/go/bin/maintainer contributor'
237225
# Run `semantic-release`
238226
- 'semantic-release'

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ci:
1818
default_stages: [pre-commit]
1919
repos:
2020
- repo: https://github.com/pre-commit/pre-commit-hooks
21-
rev: v5.0.0
21+
rev: v6.0.0
2222
hooks:
2323
- id: check-merge-conflict
2424
name: Check for Git merge conflicts
@@ -30,7 +30,7 @@ repos:
3030
- id: commitlint
3131
- id: commitlint-ci
3232
- repo: https://github.com/rubocop-hq/rubocop
33-
rev: v1.78.0
33+
rev: v1.79.2
3434
hooks:
3535
- id: rubocop
3636
name: Check Ruby files with rubocop
@@ -100,7 +100,7 @@ repos:
100100
)$
101101
additional_dependencies: [pygments==2.16.1]
102102
- repo: https://github.com/renovatebot/pre-commit-hooks
103-
rev: 41.42.2
103+
rev: 41.63.0
104104
hooks:
105105
- id: renovate-config-validator
106106
name: Check Renovate config with renovate-config-validator

pre-commit_semantic-release.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33
###############################################################################
44
# (A) Update `FORMULA` with `${nextRelease.version}`
55
###############################################################################
6+
67
sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA
78

89

910
###############################################################################
10-
# (B) Use `m2r2` to convert automatically produced `.md` docs to `.rst`
11+
# (B) Update `AUTHORS.md`
1112
###############################################################################
1213

13-
# Install `m2r2`
14-
pip3 install m2r2
14+
maintainer contributor \
15+
--ignore-contributors dependabot[bot],renovate[bot],semantic-release-bot
16+
17+
###############################################################################
18+
# (C) Use `m2r` to convert automatically produced `.md` docs to `.rst`
19+
###############################################################################
1520

1621
# Copy and then convert the `.md` docs
1722
cp ./*.md docs/
1823
cd docs/ || exit
19-
m2r2 --overwrite ./*.md
24+
m2r --overwrite ./*.md
2025

2126
# Change excess `H1` headings to `H2` in converted `CHANGELOG.rst`
2227
sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst

release.config.js

Lines changed: 2 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
branch: 'master',
2+
// TODO: remove this when we no longer process releases on GitLab CI
33
repositoryUrl: 'https://github.com/saltstack-formulas/syslog-ng-formula',
44
plugins: [
55
['@semantic-release/commit-analyzer', {
@@ -21,88 +21,6 @@ module.exports = {
2121
'@semantic-release/github'
2222
],
2323
generateNotes: {
24-
preset: 'angular',
25-
writerOpts: {
26-
// Required due to upstream bug preventing all types being displayed.
27-
// Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
28-
// Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
29-
transform: (commit, context) => {
30-
const issues = []
31-
32-
commit.notes.forEach(note => {
33-
note.title = 'BREAKING CHANGES'
34-
})
35-
36-
// NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
37-
if (commit.type === 'feat') {
38-
commit.type = 'Features'
39-
} else if (commit.type === 'fix') {
40-
commit.type = 'Bug Fixes'
41-
} else if (commit.type === 'perf') {
42-
commit.type = 'Performance Improvements'
43-
} else if (commit.type === 'revert') {
44-
commit.type = 'Reverts'
45-
} else if (commit.type === 'docs') {
46-
commit.type = 'Documentation'
47-
} else if (commit.type === 'style') {
48-
commit.type = 'Styles'
49-
} else if (commit.type === 'refactor') {
50-
commit.type = 'Code Refactoring'
51-
} else if (commit.type === 'test') {
52-
commit.type = 'Tests'
53-
} else if (commit.type === 'build') {
54-
commit.type = 'Build System'
55-
// } else if (commit.type === `chore`) {
56-
// commit.type = `Maintenance`
57-
} else if (commit.type === 'ci') {
58-
commit.type = 'Continuous Integration'
59-
} else {
60-
return
61-
}
62-
63-
if (commit.scope === '*') {
64-
commit.scope = ''
65-
}
66-
67-
if (typeof commit.hash === 'string') {
68-
commit.shortHash = commit.hash.substring(0, 7)
69-
}
70-
71-
if (typeof commit.subject === 'string') {
72-
let url = context.repository
73-
? `${context.host}/${context.owner}/${context.repository}`
74-
: context.repoUrl
75-
if (url) {
76-
url = `${url}/issues/`
77-
// Issue URLs.
78-
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
79-
issues.push(issue)
80-
return `[#${issue}](${url}${issue})`
81-
})
82-
}
83-
if (context.host) {
84-
// User URLs.
85-
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
86-
if (username.includes('/')) {
87-
return `@${username}`
88-
}
89-
90-
return `[@${username}](${context.host}/${username})`
91-
})
92-
}
93-
}
94-
95-
// remove references that already appear in the subject
96-
commit.references = commit.references.filter(reference => {
97-
if (issues.indexOf(reference.issue) === -1) {
98-
return true
99-
}
100-
101-
return false
102-
})
103-
104-
return commit
105-
}
106-
}
24+
preset: 'angular'
10725
}
10826
}

0 commit comments

Comments
 (0)