Skip to content

Commit

Permalink
chore: rename and fix actions (#33)
Browse files Browse the repository at this point in the history
* rename deploy actions

* rename and fix release action

* remove period after version in footer
  • Loading branch information
agus-xyz authored Aug 28, 2022
1 parent 9983794 commit adbc262
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy preview
name: CI - Preview
on: [pull_request]
jobs:
deploy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy to production
name: CI - Production
on:
push:
branches:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/ci-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI - Release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# if the action is a push, diff with the previous main commit
- name: Build changelog
id: build_changelog
run: |
echo "====== build changelog ======"
# create changelog file
echo "# What's Changed" > CHANGELOG.md
# check total app tags and the last commit tag
n_tags=`git tag -l 'v*' --sort=-v:refname | wc -l`
prev_tag=`git tag -l 'v*' --sort=-v:refname | sed '2q;d'`
if [ $n_tags -eq 1 ]; then
last_commit=`git rev-list --max-parents=0 HEAD`
else
last_commit=`git rev-list -n 1 $prev_tag`
fi
# fill changelog with commit descriptions
# set max tries equal to the maximum of commits as protection
max_tries=`git rev-list --count HEAD`
i=0
while [ `git rev-parse HEAD~$i` != $last_commit ] && [ $i -lt $((max_tries-1)) ]
do
echo '- ' `git show -s --format=%s HEAD~$i` >> CHANGELOG.md
i=$((i+1))
done
# set full changelog url
echo >> CHANGELOG.md
compare=""
if [ $n_tags -eq 1 ]; then
compare=$last_commit
else
compare=$prev_tag
fi
compare="${compare}...`git tag -l 'v*' --sort=-v:refname | sed '1q;d'`"
echo "**Full Changelog**: https://github.com/boxfish-studio/fontana/compare/${compare}" >> CHANGELOG.md
- name: Create Release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Fontana ${{ github.ref }}
draft: true
body_path: CHANGELOG.md
25 changes: 0 additions & 25 deletions .github/workflows/release.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Home: NextPage<{ HAS_MONGO_URI: boolean }> = ({ HAS_MONGO_URI }) => {
</div>
<Toast />
<footer>
{version && <p className="color-fg-muted">Fontana {version}. </p>}
{version && <p className="color-fg-muted">Fontana {version}</p>}
<p className="color-fg-muted">
With{" "}
<StyledOcticon icon={HeartFillIcon} size={16} color="#666666" />{" "}
Expand Down

0 comments on commit adbc262

Please sign in to comment.