Skip to content

doc(CHANGELOG): v0.1.1 (#8) #2

doc(CHANGELOG): v0.1.1 (#8)

doc(CHANGELOG): v0.1.1 (#8) #2

Workflow file for this run

name: Release
on:
push:
branches: [main]
paths: ["CHANGELOG.md"]
permissions: write-all
jobs:
release:
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack:latest
env:
SERVICES: dynamodb
ports:
- 4566:4566
env:
GO_VERSION: "1.23.0"
AWS_ACCESS_KEY_ID: ABC1234567890
AWS_SECRET_ACCESS_KEY: ABC1234567890
AWS_REGION: ap-northeast-1
DYNAMODB_ENDPOINT: http://127.0.0.1:4566
steps:
- uses: Kesin11/actions-timeline@v2
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: go.sum
- name: Unit Test
run: |
go test -v -coverpkg='github.com/miyamo2/pqxd' -coverprofile=coverage.out
- name: Setup Table
working-directory: tests/integration
run: |
aws dynamodb create-table --cli-input-json file://testdata/table-def.json --endpoint-url ${{ env.DYNAMODB_ENDPOINT }}
- name: Integration Test
working-directory: tests/integration
run: |
go test -v -coverpkg='github.com/miyamo2/pqxd' -coverprofile=coverage.out
- name: Extract Version
id: versioning
run: |
VERSION="v$(sed -n 's/##\s\([0-9.]*\)\s.*/\1/p' CHANGELOG.md | head -1)"
echo ::set-output name=version::$VERSION
- name: Extract changes from prev version
run: |
git fetch --prune --unshallow
PRETAG=$(git tag --sort -v:refname | head -1)
CURRENTTAG=${{ steps.versioning.outputs.version }}
echo "## What's Changed in ${CURRENTTAG}" > diff-changelog.txt
if [ -z "$PRETAG" ]
then
cat CHANGELOG.md | sed -e 's/##\s[0-9.]*\s.*//g' >> diff-changelog.txt
else
git diff $PRETAG..${{ github.sha }} -- CHANGELOG.md | grep -E '^\+' | grep -v '+++' | sed -e 's/^\+//g' | sed -e 's/##\s[0-9.]*\s.*//g' | sed -e '/^$/d' >> diff-changelog.txt
echo "" >> diff-changelog.txt
echo "**Full Changelog**: https://github.com/miyamo2/pqxd/compare/${PRETAG}...${CURRENTTAG}" >> diff-changelog.txt
fi
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.versioning.outputs.version }}
generate_release_notes: false
body_path: diff-changelog.txt