Skip to content

Commit 896f7a1

Browse files
committed
feat: add semantic versioning and automated releases
- Add semantic-release configuration - Create automated release workflow - Enable artifact uploads to GitHub releases - Add changelog generation Commit format for releases: - feat: new feature (minor bump) - fix: bug fix (patch bump) - BREAKING CHANGE: major bump
1 parent 8a0e759 commit 896f7a1

File tree

2 files changed

+34
-56
lines changed

2 files changed

+34
-56
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,23 @@
1-
name: Create Release
1+
name: Release
22

33
on:
44
push:
5-
tags:
6-
- 'v*.*.*'
5+
branches: [main, master]
76

8-
# Cancel previous runs on the same PR
9-
concurrency:
10-
group: ${{ github.workflow }}-${{ github.ref }}
11-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12-
13-
14-
15-
# Minimal permissions by default
167
permissions:
17-
contents: read
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
concurrency:
13+
group: release-\${{ github.ref }}
14+
cancel-in-progress: false
1815

1916
jobs:
20-
build:
21-
name: Create Release
22-
runs-on: ubuntu-latest
23-
steps:
24-
- name: Checkout code
25-
uses: actions/checkout@v6
26-
with:
27-
fetch-depth: 0
28-
29-
- name: Get the version
30-
id: get_version
31-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
32-
33-
- name: Generate changelog
34-
id: changelog
35-
uses: metcalfc/[email protected]
36-
with:
37-
myToken: ${{ secrets.GITHUB_TOKEN }}
38-
39-
- name: Create Release
40-
id: create_release
41-
uses: actions/create-release@v1
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
with:
45-
tag_name: ${{ steps.get_version.outputs.VERSION }}
46-
release_name: Release ${{ steps.get_version.outputs.VERSION }}
47-
body: |
48-
## Changes in this Release
49-
50-
${{ steps.changelog.outputs.changelog }}
51-
52-
## SSM Documents
53-
54-
This release includes the following SSM Automation documents:
55-
56-
- `attach_policies_to_role.yaml`: Attaches IAM policies to a role
57-
- `s3_encryption.yaml`: Enables server-side encryption on S3 buckets
58-
- `ec2_instance_patching.yaml`: Patches EC2 instances
59-
- `create_and_tag_resources.yaml`: Creates and tags AWS resources
60-
- `security_group_audit.yaml`: Audits and remediates security groups
61-
- `maintenance_window_setup.yaml`: Sets up SSM maintenance windows
62-
draft: false
63-
prerelease: false
17+
release:
18+
uses: thomasvincent/.github/.github/workflows/reusable-semantic-release.yml@main
19+
with:
20+
project-type: 'nodejs'
21+
build-artifacts: true
22+
upload-artifacts: true
23+
secrets: inherit

.releaserc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"branches": ["main", "master"],
3+
"plugins": [
4+
["@semantic-release/commit-analyzer", {
5+
"preset": "conventionalcommits"
6+
}],
7+
["@semantic-release/release-notes-generator", {
8+
"preset": "conventionalcommits"
9+
}],
10+
"@semantic-release/changelog",
11+
["@semantic-release/npm", {"npmPublish": false}],
12+
"@semantic-release/github",
13+
["@semantic-release/git", {
14+
"assets": ["CHANGELOG.md", "package.json", "Cargo.toml", "pyproject.toml"],
15+
"message": "chore(release): ${nextRelease.version} [skip ci]"
16+
}]
17+
]
18+
}

0 commit comments

Comments
 (0)