Skip to content

Commit

Permalink
Merge pull request #70 from djh00t/pre-release
Browse files Browse the repository at this point in the history
Bump version to 1.0.0-rc.2 and update workflow configurations
  • Loading branch information
djh00t authored Oct 14, 2024
2 parents c2f0aa1 + c46835e commit 8adf49b
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/02_pre_release_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:

jobs:
release_test_and_pr:
uses: .github/workflows/tasks-python-test-pr.yaml
uses: ./.github/workflows/tasks-python-test-pr.yaml
with:
stage: "release"
secrets:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

pre_release_release:
uses: .github/workflows/tasks-node-release-pypi.yaml
uses: ./.github/workflows/tasks-node-release-pypi.yaml
with:
stage: "release"
secrets:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/semantic-release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# Make sure packages are installed
npm install
npm install --save-dev @semantic-release/release-notes-generator@latest

# Determine if this is a pre-release or a release
if [[ "$1" == "pre-release" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tasks-semantic-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ cmd_logger() {
if [[ "$1" == "pre-release" ]]; then
RELEASE_TYPE="pre-release"
RELEASE_BRANCH_PREFIX="rc-v"
RELEASERC_FILE=".releaserc-pre-release.js"
RELEASERC_FILE=$(pwd)/".releaserc.pre-release.js"
elif [[ "$1" == "release" ]]; then
RELEASE_TYPE="release"
RELEASE_BRANCH_PREFIX="v"
RELEASERC_FILE=".releaserc-release.js"
RELEASERC_FILE=$(pwd)/".releaserc.release.js"
else
echo "Invalid release type. Exiting..."
exit 1
Expand Down
30 changes: 26 additions & 4 deletions .releaserc.pre-release.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// .releaserc.pre-release.js
module.exports = {
branches: [
{ name: "main" },
{ name: "rc", prerelease: true }
{ name: "main" }, // Your main development branch
{ name: "pre-release", prerelease: "rc" } // Pre-release with "rc" identifier
],
repositoryUrl: "https://github.com/djh00t/sops-pre-commit.git",
tagFormat: "${version}", // Ensures proper SemVer format for the version
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand All @@ -22,7 +22,7 @@ module.exports = {
{
assets: ["README.md", "pyproject.toml", "CHANGELOG.md"],
message:
"ci(release-candidate): Update version to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
"chore(release-candidate): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
pushRepo: "https://github.com/djh00t/sops-pre-commit.git",
push: false,
},
Expand Down Expand Up @@ -58,6 +58,28 @@ module.exports = {
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES"],
},
writerOpts: {
transform: (commit, context) => {
if (commit.committerDate) {
commit.committerDate = new Date(commit.committerDate).toISOString();
}

// Transform commit types to human-friendly descriptions
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 {
commit.type = 'Other Changes';
}

return commit;
},
commitsSort: ["subject", "scope"],
},
};
26 changes: 24 additions & 2 deletions .releaserc.release.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// .releaserc.release.js
module.exports = {
branches: [{ name: "release", prerelease: false }],
repositoryUrl: "https://github.com/djh00t/sops-pre-commit.git",
Expand All @@ -19,7 +18,7 @@ module.exports = {
{
assets: ["README.md", "pyproject.toml", "CHANGELOG.md"],
message:
"ci(release): Update version to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
pushRepo: "https://github.com/djh00t/sops-pre-commit.git",
push: false,
},
Expand Down Expand Up @@ -55,6 +54,29 @@ module.exports = {
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES"],
},
writerOpts: {
transform: (commit, context) => {
// Ensure the commit date is formatted correctly
if (commit.committerDate) {
commit.committerDate = new Date(commit.committerDate).toISOString();
}

// Transform commit types to human-friendly descriptions
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 {
commit.type = 'Other Changes';
}

return commit;
},
commitsSort: ["subject", "scope"],
},
};
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sops-pre-commit"
version = "0.0.5"
version = "v1.0.0-rc.2"
description = "Check for unencrypted secrets and encrypt them using sops and age/gpg. Forked from https://github.com/onedr0p/sops-pre-commit"
authors = ["David Hooton <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 8adf49b

Please sign in to comment.