Skip to content

Commit

Permalink
feat(releases): Refactor Github Actions for releases. Add CHANGELOG g…
Browse files Browse the repository at this point in the history
…eneration.
  • Loading branch information
Ziwi01 committed Jan 8, 2024
1 parent 77db3c6 commit 562c22a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Docusaurus site to Pages
name: Deploy docs Pages

on:
push:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
path: docs-web/build

# Deployment job
deploy:
deploy-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
42 changes: 38 additions & 4 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,43 @@ jobs:
working-directory: ./ansible
run: ansible-playbook -i inventory.yml setup-ubuntu.yml

- uses: "marvinpinto/action-automatic-releases@latest"
- name: Get previous tag
id: previousTag
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: latest
toTag: ${{ env.previousTag }}

- name: Create Pre-Release
uses: ncipollo/release-action@v1.12.0
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
allowUpdates: true
draft: false
makeLatest: true
tag: latest
prerelease: true
title: "Pre-release Build"
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }}'
file_pattern: CHANGELOG.md

# - uses: "marvinpinto/action-automatic-releases@latest"
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "latest"
# prerelease: true
# title: "Pre-release Build"
6 changes: 3 additions & 3 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ echo 'git add'
git add .

echo 'git commit updated versions'
git commit -a -m 'release: Update versions'
git commit -a -m 'build: Release updated versions'

echo 'Update docs'
rsync -avrE ${SCRIPT_DIR}/docs-web/docs/ ${SCRIPT_DIR}/docs-web/versioned_docs/version-stable/

echo 'git commit updated docs'
git commit -a -m 'release: Update docs'
git commit -a -m 'build: Release updated docs'

echo 'git push'
git push
Expand All @@ -50,7 +50,7 @@ echo 'git add'
git add .

echo 'git commit'
git commit -a -m 'release: Set latest versions for development'
git commit -a -m 'build: Set latest versions for development'

echo 'git push'
git push

0 comments on commit 562c22a

Please sign in to comment.