Skip to content

Commit

Permalink
feat: New Github Actions release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziwi01 committed Jan 8, 2024
1 parent d648497 commit f4aea99
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fix grub-efi-amd64 error
run: |
Expand All @@ -23,18 +25,25 @@ jobs:
- name: Prepare for setup
run: sudo sh prepare-ubuntu.sh

- name: Setup environment
- name: Build Proveasio'ned environment
working-directory: ./ansible
run: ansible-playbook -i inventory.yml setup-ubuntu.yml

- name: Push latest tag
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@users.noreply.github.com"
git tag latest -f
git push origin latest -f
- 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
- name: Generate CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
Expand All @@ -57,13 +66,6 @@ jobs:
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
branch: ${{ github.ref_name }}
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"
29 changes: 27 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,33 @@ jobs:
runs-on: "ubuntu-22.04"

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- 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: Generate CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}

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

0 comments on commit f4aea99

Please sign in to comment.