Skip to content

Commit

Permalink
release from changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
ktong committed Feb 4, 2024
1 parent 2f7a808 commit 66bdc5a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write

jobs:
release:
name: From changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get latest release info
id: query-release-info
uses: release-flow/keep-a-changelog-action@v2
with:
command: query
version: latest

- name: Display release info
run: |
echo "Version: ${{ steps.query-release-info.outputs.version }}"
echo "Date: ${{ steps.query-release-info.outputs.release-date }}"
echo "${{ steps.query-release-info.outputs.release-notes }}"
- name: Get latest release
id: latest-release
uses: actions/github-script@v7
continue-on-error: true
with:
script: |
return await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "v${{ steps.query-release-info.outputs.version }}"
})
- name: Create release
uses: actions/github-script@v7
if: steps.latest-release.outcome != 'success'
with:
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: "v${{ steps.query-release-info.outputs.version }}",
target_commitish: context.sha
name: "v${{ steps.query-release-info.outputs.version }}"
body: "${{ steps.query-release-info.outputs.release-notes }}"
})
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- Switch from mitchellh/mapstructure to go-viper/mapstructure (#69).

## [v0.3.0] - 11/17/2023
## [0.3.0] - 2023-11-17

### Changed

- [BREAKING] Redesign API.

## [v0.2.0] - 3/18/2023
## [0.2.0] - 2023-03-18

### Removed

- Remove file.WithLog to favor standard log.Printf (#32).

## [v0.1.0] - 3/12/2023
## [0.1.0] - 2023-03-12

Initial alpha release.

0 comments on commit 66bdc5a

Please sign in to comment.