Skip to content

Commit

Permalink
ci(github): update github-deploy job (#3)
Browse files Browse the repository at this point in the history
* chore(makefile): update `release` command
* ci(github): update github deploy job
* docs(changelog): update `git-cliff` config
* docs(readme): update badges
  • Loading branch information
DeadNews authored Apr 8, 2024
1 parent 419dc7a commit 613147e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ jobs:
needs: [lint-py, lint, tests]
environment:
name: galaxy
url: https://galaxy.ansible.com/ui/repo/published/deadnews/util/
url: https://galaxy.ansible.com/ui/repo/published/deadnews/util
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set version in galaxy.yml
run: |
VERSION=${GITHUB_REF#refs/tags/v}
sed -re "s/^version:.*$/version: ${VERSION}/" -i galaxy.yml
sed "s|^version:.*$|version: ${GITHUB_REF_NAME#v}|" -i galaxy.yml
- name: Upload collection to Ansible Galaxy
uses: ansible/ansible-publish-action@v1.0.0
Expand All @@ -155,20 +154,19 @@ jobs:
environment: github-releases
permissions:
contents: write
env:
CHANGELOG: https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md
PRERELEASE: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Create GitHub Release
run: |
set -x
PRERELEASE=$([[ ${{ github.ref }} =~ (alpha|beta|rc) ]] && echo true || echo false)
CHANGELOG="https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md"
gh release create ${{ github.ref_name }} \
--title ${{ github.ref_name }} \
--notes="See [the CHANGELOG](${CHANGELOG}) for more details." \
--draft=${PRERELEASE} \
--prerelease=${PRERELEASE}
--notes="See [the CHANGELOG](${{ env.CHANGELOG }}) for more details." \
--draft=${{ env.PRERELEASE }} \
--prerelease=${{ env.PRERELEASE }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[files]
extend-exclude = ["CHANGELOG.md"]
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ test-%:
test-vg-%:
pushd roles/$* && poetry run molecule test -s $*_vagrant; popd

get-next:
bumped:
git cliff --bumped-version

# make release-tag_name
# make release-v1.0.0-alpha.0
# make release-$(git cliff --bumped-version)-alpha.0
release-%: checks
git cliff -o CHANGELOG.md --tag $*
pre-commit run --files CHANGELOG.md
pre-commit run --files CHANGELOG.md || pre-commit run --files CHANGELOG.md
git add CHANGELOG.md
git commit -m "chore(release): prepare for $*"
git push
git tag -a $* -m "chore(release): $*"
git push --tags
git push origin $*
git tag --verify $*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
[![GitHub: Tag](https://img.shields.io/github/v/tag/deadnews/ansible-collection-util?logo=github&logoColor=white)](https://github.com/deadnews/ansible-collection-util)
[![Documentation](https://img.shields.io/badge/documentation-gray.svg?logo=ansible&logoColor=white)](https://galaxy.ansible.com/ui/repo/published/deadnews/util/docs/)
[![Changelog](https://img.shields.io/badge/changelog-gray.svg?logo=github&logoColor=white)](https://github.com/deadnews/ansible-collection-util/blob/main/CHANGELOG.md)
[![CI: main](https://img.shields.io/github/actions/workflow/status/deadnews/ansible-collection-util/main.yml?branch=main&logo=github&logoColor=white&label=main)](https://github.com/deadnews/ansible-collection-util/actions/workflows/main.yml)
[![CI: pre-commit](https://results.pre-commit.ci/badge/github/DeadNews/ansible-collection-util/main.svg)](https://results.pre-commit.ci/latest/github/deadnews/ansible-collection-util/main)
[![CI: Main](https://img.shields.io/github/actions/workflow/status/deadnews/ansible-collection-util/main.yml?branch=main&logo=github&logoColor=white&label=main)](https://github.com/deadnews/ansible-collection-util/actions/workflows/main.yml)

## Install

Expand Down
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ commit_parsers = [
{ message = "^chore\\(release\\)", skip = true },
{ message = "^fix\\(deps.*\\)", group = "<!-- 92 -->⬆️ Dependencies" },
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug fixes" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
Expand Down

0 comments on commit 613147e

Please sign in to comment.