Skip to content

Commit

Permalink
Merge branch 'main' into more-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thejmitchener authored Nov 14, 2024
2 parents 7a526c7 + 383bc98 commit 57e12e6
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 15 deletions.
13 changes: 10 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
interval: 'monthly'
target-branch: main

- package-ecosystem: 'composer'
directory: '/'
schedule:
interval: 'weekly'
interval: 'monthly'
ignore:
- dependency-name: "ralphjsmit/laravel-glide"
- dependency-name: '*'
update-types:
- 'version-update:semver-major'
target-branch: main

- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
interval: 'monthly'
target-branch: main
54 changes: 51 additions & 3 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ jobs:
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v4
with:
application_id: ${{ vars.FUELVIEWS_BOT_APP_ID}}
application_id: ${{ vars.FUELVIEWS_BOT_APP_ID }}
application_private_key: ${{ secrets.FUELVIEWS_BOT_APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: '0'
token: ${{ steps.get_workflow_token.outputs.token }}

- name: Bump version and push tag
id: bump_version
Expand All @@ -38,6 +39,54 @@ jobs:
DEFAULT_BUMP: patch
WITH_V: true
RELEASE_BRANCHES: main
BRANCH_HISTORY: last

- name: Generate Release Notes
id: generate_release_notes
shell: bash
env:
TOKEN: ${{ steps.get_workflow_token.outputs.token }}
NEW_TAG: ${{ steps.bump_version.outputs.new_tag }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
run: |
response=$(curl -s -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/$OWNER/$REPO/releases/generate-notes \
-d @- <<EOF
{
"tag_name": "$NEW_TAG",
"target_commitish": "main"
}
EOF
)
# Check if the response contains an error
if echo "$response" | grep -q '"message":'; then
echo "Error generating release notes:"
echo "$response"
exit 1
fi
body=$(echo "$response" | jq -r '.body')
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$body" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ steps.bump_version.outputs.new_tag }}
release-notes: ${{ steps.generate_release_notes.outputs.body }}

- name: Commit updated CHANGELOG
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
run: |
git config user.name "fuelviews-app[bot]"
git config user.email "fuelviews-app[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit -m "Chore: update changelog for ${{ steps.bump_version.outputs.new_tag }} [skip ci]"
git push origin main
- name: Release
id: release
Expand All @@ -46,5 +95,4 @@ jobs:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
with:
tag_name: ${{ steps.bump_version.outputs.new_tag }}
generate_release_notes: true

body: ${{ steps.generate_release_notes.outputs.body }}
18 changes: 9 additions & 9 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

release:
types: [released]
types: [published]

permissions:
contents: write
Expand All @@ -19,27 +19,27 @@ jobs:
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v4
with:
application_id: ${{ vars.FUELVIEWS_BOT_APP_ID}}
application_id: ${{ vars.FUELVIEWS_BOT_APP_ID }}
application_private_key: ${{ secrets.FUELVIEWS_BOT_APP_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
ref: 'main'
token: ${{ steps.get_workflow_token.outputs.token }}

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
latest-version: ${{ github.event.release.tag_name }}
release-notes: ${{ github.event.release.body }}

- name: Amend latest commit with updated CHANGELOG
- name: Commit updated CHANGELOG
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
run: |
git config user.name "fuelviews-app[bot]"
git config user.email "fuelviews-app[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit --amend --no-edit
git push origin main --force-with-lease
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
git commit -m "Update CHANGELOG for release ${{ github.event.release.tag_name }}"
git push origin main

0 comments on commit 57e12e6

Please sign in to comment.