Skip to content

Commit d9aec46

Browse files
authored
Merge pull request #149 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.0
2 parents 245971f + cb78aeb commit d9aec46

File tree

6 files changed

+33
-101
lines changed

6 files changed

+33
-101
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.0
33
_src_path: https://github.com/dafyddj/copier-ssf-ci
44
failure_permitted_ignored: []
55
failure_permitted_patterns: []

.github/workflows/main.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ 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.4.32@sha256:fa9eef397583add95f4fccefa6ecbbf7a3845d6168f07393da7bc619696b246b
2929
runs-on: ubuntu-latest
3030
timeout-minutes: 5
3131
steps:
@@ -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.1.0
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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 & 9 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.98@sha256:f227ba6da3c684b5506fa338bdb82b17e7a7a3f75f56b2407632b43a7e7276a2'
19+
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.67@sha256:2887fb02ee694a97241777b043b1942b7e6803080e06dd18633f083eed463844'
20+
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.67@sha256:2887fb02ee694a97241777b043b1942b7e6803080e06dd18633f083eed463844'
21+
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.4.32@sha256:fa9eef397583add95f4fccefa6ecbbf7a3845d6168f07393da7bc619696b246b'
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.1.0'
2424
# `services`
2525
services_docker_dind: &services_docker_dind
26-
- 'docker:28.3.2-dind@sha256:5415fccf3da3aed821efb2258cb7dcf52fb9bb0627b02d45338e887c352c4bce'
26+
- 'docker:28.3.2-dind@sha256:44383404ebf0c36243f5969f0dddd23c204ea3bb185e7473a4141f6ccfd07b53'
2727
# yamllint enable rule:line-length
2828
# `variables`
2929
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
@@ -229,13 +229,10 @@ ubuntu-2004-3006-14: {extends: '.test_instance'}
229229
# `release` stage: `semantic-release`
230230
###############################################################################
231231
semantic-release:
232-
only: *only_branch_master_parent_repo
233232
stage: *stage_release
234233
image: *image_semanticrelease
235234
variables:
236235
MAINTAINER_TOKEN: '${GH_TOKEN}'
237236
script:
238-
# Update `AUTHORS.md`
239-
- '${HOME}/go/bin/maintainer contributor'
240237
# Run `semantic-release`
241238
- 'semantic-release'

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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.0
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.43.0
104104
hooks:
105105
- id: renovate-config-validator
106106
name: Check Renovate config with renovate-config-validator

pre-commit_semantic-release.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
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 --ignore-contributors semantic-release-bot,renovate[bot]
15+
16+
###############################################################################
17+
# (C) Use `m2r` to convert automatically produced `.md` docs to `.rst`
18+
###############################################################################
1519

1620
# Copy and then convert the `.md` docs
1721
cp ./*.md docs/
1822
cd docs/ || exit
19-
m2r2 --overwrite ./*.md
23+
m2r --overwrite ./*.md
2024

2125
# Change excess `H1` headings to `H2` in converted `CHANGELOG.rst`
2226
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/postfix-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)