Skip to content

Commit 2fed531

Browse files
authored
Added a changelog (#18)
* Add changelog and CI/CD * Updated deploy CI/CD * Add automatic issue labeler CI/CD * Add automatic issue closer * perf: Release of docs 1.0.0
1 parent c800597 commit 2fed531

File tree

6 files changed

+142
-12
lines changed

6 files changed

+142
-12
lines changed

.github/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
categories:
6+
- title: Added
7+
labels:
8+
- 'Type: Enhancement'
9+
- title: Changed
10+
labels:
11+
- 'Type: Maintenance'
12+
- title: Deprecated
13+
labels:
14+
- 'Type: Deprecation'
15+
- title: Removed
16+
labels:
17+
- 'Type: Removed'
18+
- title: Fixed
19+
labels:
20+
- 'Type: Bug'
21+
- title: Security
22+
labels:
23+
- 'Type: Vulnerability'

.github/workflows/changelog.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Update Changelog
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update-changelog:
9+
name: Update Changelog
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout Source Code
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
ref: ${{ github.event.release.target_commitish }}
19+
token: ${{ secrets.CHANGELOG_TOKEN }}
20+
21+
- name: Extract Release Date
22+
id: release_date
23+
run: |
24+
echo "date=$(git log -1 --date=short --format=%ad '${{ github.event.release.tag_name }}')" >> $GITHUB_OUTPUT;
25+
26+
- name: Update Changelog
27+
uses: stefanzweifel/changelog-updater-action@v1
28+
with:
29+
release-date: ${{ steps.release_date.outputs.date }}
30+
release-notes: ${{ github.event.release.body }}
31+
latest-version: ${{ github.event.release.tag_name }}
32+
33+
- name: Build Commit Message
34+
run: |
35+
echo "Update CHANGELOG" >> commitmessage.txt
36+
echo "[skip ci]" >> commitmessage.txt
37+
38+
- name: Set Commit Message
39+
id: commit_message
40+
run: |
41+
echo 'commit_message<<EOF' >> $GITHUB_OUTPUT
42+
cat commitmessage.txt >> $GITHUB_OUTPUT
43+
echo 'EOF' >> $GITHUB_OUTPUT
44+
45+
- name: Remove Commit Message File
46+
run: rm -rf commitmessage.txt
47+
48+
- name: Commit Updated Changelog
49+
uses: stefanzweifel/git-auto-commit-action@v4
50+
with:
51+
branch: ${{ github.event.release.target_commitish }}
52+
commit_message: ${{ steps.commit_message.outputs.commit_message }}
53+
file_pattern: CHANGELOG.md
54+
push_options: '--force'

.github/workflows/issue.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Label Issues
2+
3+
on:
4+
issues:
5+
types:
6+
- reopened
7+
- opened
8+
9+
jobs:
10+
label-issues:
11+
name: Label Issue
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
steps:
16+
- uses: actions/github-script@v6
17+
with:
18+
script: |
19+
github.rest.issues.addLabels({
20+
issue_number: context.issue.number,
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
labels: ["Status: In Progress"]
24+
})

.github/workflows/main.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
name: Docs CI/CD
1+
name: Deploy Documentation
22

33
on:
44
push:
55
branches:
66
- master
7-
- staging
87

98
jobs:
10-
build:
11-
name: Deploy Docs
9+
deploy:
10+
name: Deploy Documentation
1211
runs-on: ubuntu-latest
1312
timeout-minutes: 10
1413
steps:
@@ -18,10 +17,11 @@ jobs:
1817
- name: Setup Node
1918
uses: actions/setup-node@v3
2019
with:
21-
node-version: 16
20+
node-version: 18
21+
cache: 'npm'
2222

2323
- name: Install Dependencies
24-
run: npm install
24+
run: npm ci
2525

2626
- name: Build Application
2727
run: npm run docs:build
@@ -38,19 +38,16 @@ jobs:
3838
append_to_pre_release_tag: prerelease
3939

4040
- name: Setup AWS Credentials
41-
if: github.ref == 'refs/heads/master'
4241
uses: aws-actions/configure-aws-credentials@v1
4342
with:
4443
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
4544
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4645
aws-region: us-east-1
4746

4847
- name: Deploy to S3
49-
if: github.ref == 'refs/heads/master'
5048
run: aws s3 sync ./docs/.vitepress/dist/ s3://${{ secrets.AWS_BUCKET_NAME }} --delete
5149

5250
- name: Invalidate Cloudfront Cache
53-
if: github.ref == 'refs/heads/master'
5451
uses: chetan/invalidate-cloudfront-action@v2
5552
env:
5653
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
@@ -60,7 +57,6 @@ jobs:
6057
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6158

6259
- name: Trigger Algolia Crawler Index
63-
if: github.ref == 'refs/heads/master'
6460
uses: algolia/algoliasearch-crawler-github-actions@v1.0.10
6561
with:
6662
crawler-user-id: ${{ secrets.CRAWLER_USER_ID }}
@@ -72,8 +68,9 @@ jobs:
7268

7369
- name: Create Release
7470
uses: ncipollo/release-action@v1
75-
if: github.ref == 'refs/heads/master'
7671
with:
7772
tag: ${{ steps.tag_version.outputs.new_tag }}
7873
name: ${{ steps.tag_version.outputs.new_tag }}
79-
body: ${{ steps.tag_version.outputs.changelog }}
74+
generateReleaseNotes: true
75+
makeLatest: true
76+
token: ${{ secrets.RELEASE_TOKEN }}

.github/workflows/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Close Inactive Issues/PRs
2+
3+
on:
4+
schedule:
5+
- cron: "30 1 * * *"
6+
7+
jobs:
8+
close-issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/stale@v5
15+
with:
16+
days-before-issue-stale: 30
17+
days-before-issue-close: 14
18+
stale-issue-label: "stale"
19+
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
20+
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
21+
days-before-pr-stale: -1
22+
days-before-pr-close: -1
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Release Notes
2+
3+
## [Unreleased](https://github.com/DeschutesDesignGroupLLC/PERSCOM-3.0-Docs/compare/v0.0.24...HEAD)
4+
5+
## [v0.0.24](https://github.com/DeschutesDesignGroupLLC/PERSCOM-3.0-Docs/compare/v0.0.23...v0.0.24) - 2023-02-13
6+
7+
### Changed
8+
9+
- Updated docs by @JonErickson in https://github.com/DeschutesDesignGroupLLC/PERSCOM-3.0-Docs/pull/17

0 commit comments

Comments
 (0)