mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 16:32:50 -05:00
Switch to dispatch-style release workflow
This commit is contained in:
93
.github/workflows/release.yml
vendored
93
.github/workflows/release.yml
vendored
@@ -1,70 +1,97 @@
|
|||||||
name: Create Release
|
# Release from a dispatch event from the danklinux repo
|
||||||
|
name: Create Release from DMS
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
repository_dispatch:
|
||||||
tags:
|
types: [dms_release]
|
||||||
- 'v*'
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: release-${{ github.ref_name }}
|
group: release-${{ github.event.client_payload.tag }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create_release:
|
create_release_from_dms:
|
||||||
name: 📦 Create GitHub Release
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
env:
|
||||||
|
TAG: ${{ github.event.client_payload.tag }}
|
||||||
|
DMS_REPO: ${{ github.event.client_payload.dms_repo }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Fetch full history for changelog generation
|
fetch-depth: 0
|
||||||
|
|
||||||
# Create VERSION file
|
- name: Ensure VERSION and tag
|
||||||
- name: Create VERSION file
|
|
||||||
run: |
|
run: |
|
||||||
echo "${{ github.ref_name }}" > VERSION
|
set -euxo pipefail
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git add VERSION
|
|
||||||
git commit -m "Add VERSION file for ${{ github.ref_name }}"
|
|
||||||
git tag -f ${{ github.ref_name }}
|
|
||||||
git push origin ${{ github.ref_name }} --force
|
|
||||||
|
|
||||||
# Generate changelog
|
# create/update VERSION file to match incoming tag
|
||||||
|
echo "${TAG}" > VERSION
|
||||||
|
if ! git diff --quiet -- VERSION; then
|
||||||
|
git add VERSION
|
||||||
|
git commit -m "Add VERSION file for ${TAG} (from DMS)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If tag doesn't exist (or differs), (re)create it
|
||||||
|
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
|
||||||
|
echo "Tag ${TAG} already exists"
|
||||||
|
else
|
||||||
|
git tag "${TAG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Push commit (if any) and tag
|
||||||
|
git push --follow-tags origin HEAD
|
||||||
|
|
||||||
- name: Generate Changelog
|
- name: Generate Changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
run: |
|
run: |
|
||||||
# Get the previous tag
|
set -e
|
||||||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$PREVIOUS_TAG" ]; then
|
if [ -z "$PREVIOUS_TAG" ]; then
|
||||||
echo "No previous tag found, using all commits"
|
|
||||||
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" | head -50)
|
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" | head -50)
|
||||||
else
|
else
|
||||||
echo "Generating changelog from $PREVIOUS_TAG to HEAD"
|
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" "${PREVIOUS_TAG}..${TAG}")
|
||||||
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the changelog with proper formatting
|
|
||||||
cat > CHANGELOG.md << EOF
|
cat > CHANGELOG.md << EOF
|
||||||
## What's Changed
|
## What's Changed
|
||||||
|
|
||||||
$CHANGELOG
|
$CHANGELOG
|
||||||
|
|
||||||
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${{ github.ref_name }}
|
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${TAG}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Set output for use in release step
|
|
||||||
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
||||||
cat CHANGELOG.md >> $GITHUB_OUTPUT
|
cat CHANGELOG.md >> $GITHUB_OUTPUT
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Create GitHub Release
|
- name: Create/Update DankMaterialShell Release
|
||||||
- name: Create GitHub Release
|
uses: softprops/action-gh-release@v2
|
||||||
uses: comnoco/create-release-action@v2.0.5
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ env.TAG }}
|
||||||
release_name: Release ${{ github.ref_name }}
|
name: Release ${{ env.TAG }}
|
||||||
body: ${{ steps.changelog.outputs.changelog }}
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
prerelease: ${{ contains(env.TAG, '-') }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Download DMS release assets
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
# gh is preinstalled on ubuntu-24.04; auth via GH_TOKEN env
|
||||||
|
gh release download "${TAG}" -R "${DMS_REPO}" --dir ./_dms_assets
|
||||||
|
|
||||||
|
- name: Attach DMS assets to DankMaterialShell release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.TAG }}
|
||||||
|
files: _dms_assets/**
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -15,19 +15,20 @@ Column {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
property bool isInitialized: false
|
||||||
|
|
||||||
function loadValue() {
|
function loadValue() {
|
||||||
const settings = findSettings()
|
const settings = findSettings()
|
||||||
if (settings && settings.pluginService) {
|
if (settings && settings.pluginService) {
|
||||||
value = settings.loadValue(settingKey, defaultValue)
|
const loadedValue = settings.loadValue(settingKey, defaultValue)
|
||||||
textField.text = value
|
value = loadedValue
|
||||||
|
textField.text = loadedValue
|
||||||
|
isInitialized = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loadValue()
|
|
||||||
}
|
|
||||||
|
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
if (!isInitialized) return
|
||||||
const settings = findSettings()
|
const settings = findSettings()
|
||||||
if (settings) {
|
if (settings) {
|
||||||
settings.saveValue(settingKey, value)
|
settings.saveValue(settingKey, value)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
[](https://github.com/AvengeMedia/DankMaterialShell/commits/master)
|
[](https://github.com/AvengeMedia/DankMaterialShell/commits/master)
|
||||||
[](https://aur.archlinux.org/packages/dms-shell-bin)
|
[](https://aur.archlinux.org/packages/dms-shell-bin)
|
||||||
[)](https://aur.archlinux.org/packages/dms-shell-git)
|
[)](https://aur.archlinux.org/packages/dms-shell-git)
|
||||||
|
[](https://ko-fi.com/avengemediallc)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user