Skip to content

Commit

Permalink
cicd: setting up release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
zostay committed Jun 13, 2024
1 parent 789b3c2 commit 8324f3c
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 28 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/prepare.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release
on:
push:
branches:
- release/*

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.19
- name: Release Verseion
run: echo $RELEASE_VERSION=$(echo $GITHUB_REF_NAME | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+.*$') >> $GITHUB_ENV
- name: Version Check
run: |
if ! grep -q "$RELEASE_VERSION" version.txt; then
echo "version.txt does not match $RELEASE_VERSION!"
exit 1
fi
- name: Changes Heading Up-To-Date Check
run: |
date=$(date "+%Y-%m-%d")
header=$(head -n1 Changes.md)
if [ "$header" != "## $RELEASE_VERSION $date" ]; then
echo "Changes.md is out of date!"
echo "Expected header: ## $RELEASE_VERSION $date"
echo "Found header: $header"
exit 1
else
echo "Changes.md heading looks good."
fi
- name: Release Notes Capture
run: |
sed -n '/^## [0-9]/{:loop n; /^## [0-9]/q; p; b loop}' Changes.md > release-notes.md
echo "Release Notes Will be..."
echo "========================"
cat release-notes.md
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release
on:
push:
tags:
- v*

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions: write-all
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.19
- name: Release Verseion
run: echo $RELEASE_VERSION=$(echo $GITHUB_REF_NAME | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+.*$') >> $GITHUB_ENV
- name: Version Check
run: |
if ! grep -q "$RELEASE_VERSION" version.txt; then
echo "version.txt does not match $RELEASE_VERSION!"
exit 1
fi
- name: Changes Heading Up-To-Date Check
run: |
date=$(date "+%Y-%m-%d")
header=$(head -n1 Changes.md)
if [ "$header" != "## $RELEASE_VERSION $date" ]; then
echo "Changes.md is out of date!"
echo "Expected header: ## $RELEASE_VERSION $date"
echo "Found header: $header"
exit 1
else
echo "Changes.md heading looks good."
fi
- name: Release Notes Capture
run: |
sed -n '/^## [0-9]/{:loop n; /^## [0-9]/q; p; b loop}' Changes.md > release-notes.md
echo "Release Notes Will be..."
echo "========================"
cat release-notes.md
File renamed without changes.
26 changes: 13 additions & 13 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
v0.6.0 2023-08-12
## v0.6.0 2023-08-12

* Adding slices.Insert

v0.5.0 2023-07-25
## v0.5.0 2023-07-25

* Adding fs.CreateFS, fs.WriteFileFS, fs.ReaderFS, fs.ReaderWriterFS, and fs.WriterFS
* Adding fs.MkdirAll and fs.WriteFile

v0.4.0 2023-07-14
## v0.4.0 2023-07-14

* Added maps.MergeInPlace.
* Added slices.MapSlice and slices.MapMap.
* maps.Merge now allocates room equal to the size of all input maps in the output map.

v0.3.0 2023-07-13
## v0.3.0 2023-07-13

* Added slices.FirstIndex and slices.GrepIndex.
* Added set.NewSized and set.Diff.
* Added maps.Diff.
* Fixed missing test coverage on generic.FirstNonNil and generic.FirstNonZero.

v0.2.0 2023-07-08
## v0.2.0 2023-07-08

* Added generic.FirstNonZero and generic.FirstNonNil.
* Added maps.Merge.

v0.1.2 2023-07-07
## v0.1.2 2023-07-07

* Fix a silly release typo.

v0.1.1 2023-07-07
## v0.1.1 2023-07-07

* Added set.Set.Keys method.

v0.1.0 2023-05-27
## v0.1.0 2023-05-27

* Added generic.CountDeltas function.
* Added slices.FromRange function.
* Added strings.Increment, strings.IncrementWithSets, strings.IncrementSet, strings.NumericSet, strings.NumericSetRange, strings.LetterSet, strings.LetterSetRange, and strings.SeqSet.

v0.0.4 2023-05-27
## v0.0.4 2023-05-27

* Added a LICENSE file.

v0.0.3 2023-05-09
## v0.0.3 2023-05-09

* Added structs.ApplyDefaults function.

v0.0.2 2023-04-21
## v0.0.2 2023-04-21

* Small improvement to the behavior/performance of slices.Delete
* Added slices.Map, slices.Reduce, slices.ReduceAcc, slices.Reductions,
Expand All @@ -58,11 +58,11 @@ v0.0.2 2023-04-21
* Added slices.Shuffle, slices.Sample, slices.Uniq, and slices.UniqInPlace
functions.

v0.0.1 2023-04-17
## v0.0.1 2023-04-17

* Added slices.Concat

v0.0.0 2023-04-08
## v0.0.0 2023-04-08

* Initial release.
* Tools to makeup for limits in the std library.
Expand Down
6 changes: 6 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package std

import _ "embed"

//go:embed version.txt
var Version string
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.6.0
15 changes: 0 additions & 15 deletions zedpm.conf

This file was deleted.

0 comments on commit 8324f3c

Please sign in to comment.