Skip to content

Commit f8f331e

Browse files
authored
Merge pull request #5 from SpokaneTech/release
testing release
2 parents da8b7d7 + 7814652 commit f8f331e

9 files changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/bandit.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Bandit Security Analysis
2+
13
on: [push]
24

35
jobs:

.github/workflows/build_and_publish_docker.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,10 @@ jobs:
7575
if [ "${{ steps.vars.outputs.latest }}" = "true" ]; then
7676
echo "Also tagged as :latest"
7777
fi
78+
- name: Create GitHub Release
79+
if: startsWith(github.ref, 'refs/tags/') && steps.vars.outputs.latest == 'true'
80+
uses: softprops/action-gh-release@v1
81+
with:
82+
tag_name: ${{ steps.vars.outputs.tag }}
83+
name: Release ${{ steps.vars.outputs.tag }}
84+
generate_release_notes: true

.github/workflows/isort.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: isort
2+
13
on: [push]
24

35
jobs:

.github/workflows/mypy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: mypy
2+
13
on: [push]
24

35
jobs:

.github/workflows/pytest.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: pytest
2+
13
on: [push]
24

35
jobs:

.github/workflows/radon.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: radon
2+
13
on: [push]
24

35
jobs:

.github/workflows/release.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release and Changelog
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
push:
8+
tags:
9+
- '[0-9]+.[0-9]+.[0-9]+'
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Git
23+
run: |
24+
git config user.name "github-actions[bot]"
25+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
27+
- name: Get tag name
28+
id: tag
29+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
30+
31+
- name: Generate release notes
32+
id: release_notes
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
const tag = process.env.GITHUB_REF_NAME;
37+
const { data: commits } = await github.rest.repos.listCommits({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
per_page: 20,
41+
});
42+
43+
const notes = commits.map(c => `- ${c.commit.message.split('\n')[0]}`).join('\n');
44+
return notes;
45+
46+
- name: Create GitHub Release
47+
uses: softprops/action-gh-release@v2
48+
with:
49+
tag_name: ${{ steps.tag.outputs.tag }}
50+
name: Release ${{ steps.tag.outputs.tag }}
51+
body: ${{ steps.release_notes.outputs.result }}
52+
53+
- name: Update CHANGELOG.md
54+
run: |
55+
echo "## ${{ steps.tag.outputs.tag }}" >> CHANGELOG.md
56+
echo "" >> CHANGELOG.md
57+
echo "${{ steps.release_notes.outputs.result }}" >> CHANGELOG.md
58+
echo "" >> CHANGELOG.md
59+
git add CHANGELOG.md
60+
git commit -m "docs: update CHANGELOG for ${{ steps.tag.outputs.tag }}"
61+
git push origin HEAD

.github/workflows/ruff_format.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: ruff_format
2+
13
on: [push]
24

35
jobs:

.github/workflows/ruff_lint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: ruff_lint
2+
13
on: [push]
24

35
jobs:

0 commit comments

Comments
 (0)