Skip to content

Commit

Permalink
ci: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Aug 4, 2024
1 parent 2b76bda commit 949cfd0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 21 deletions.
11 changes: 10 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
custom: ['https://buymeacoffee.com/aetherinox']
custom: ["https://buymeacoffee.com/aetherinox"]
github: # [repo-name, aetherinox]
patreon: # Replace with a single Patreon username
open_collective: # name
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
3 changes: 2 additions & 1 deletion .github/workflows/labels-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
ASSIGN_USER: Aetherinox
BOT_NAME_1: AdminServ
BOT_NAME_2: AdminServX
BOT_NAME_3: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]
LABELS_JSON: |
[
Expand Down Expand Up @@ -82,7 +83,7 @@ env:
{ "name": "⚠ Announcement", "color": "DB4712", "description": "KeeWeb announcements" },
{ "name": "📰 Progress Report", "color": "392297", "description": "Updates on the development of KeeWeb" },
{ "name": "📦 Release", "color": "277542", "description": "Release announcements" },
{ "name": "✔️ Poll", "color": "972255", "description": "Community polls" }
{ "name": "✔️ Poll", "color": "972255", "description": "Community polls" },
{ "name": "❔ Question", "color": "FFFFFF", "description": "All questions" }
]
Expand Down
72 changes: 53 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# ---------------------------------------------------------------------------------------
# @parent : github workflow
# @desc : publish release to github
# @author : Aetherinox
# @url : https://github.com/Aetherinox
# ---------------------------------------------------------------------------------------

name: "📦 Publish › Snippets"
run-name: "📦 Publish › Snippets"

# ---------------------------------------------------------------------------------------
# triggers
# ---------------------------------------------------------------------------------------

on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -63,6 +74,10 @@ on:
type: string
default: "1"

# ---------------------------------------------------------------------------------------
# jobs
# ---------------------------------------------------------------------------------------

jobs:

# ---------------------------------------------------------------------------------------
Expand All @@ -74,12 +89,16 @@ jobs:
📦 Publish › Initialize
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.task_initialize_package_getversion.outputs.PACKAGE_VERSION }}
package_version: ${{ steps.task_initialize_package_version.outputs.PACKAGE_VERSION }}
permissions:
contents: write
packages: write
steps:

# ---------------------------------------------------------------------------------------
# Job > Initialize > Start
# ---------------------------------------------------------------------------------------

- name: "✅ Start"
id: task_initialize_start
run: |
Expand All @@ -96,19 +115,24 @@ jobs:
fetch-depth: 0

# ---------------------------------------------------------------------------------------
# Package Version > Set
# Get version from package.json VERSION value
# ---------------------------------------------------------------------------------------

- name: "👁️‍🗨️ Get Package Version"
id: task_initialize_package_getversion
- name: "👁️‍🗨️ Package Version › Get"
id: task_initialize_package_version
run: |
VER=$(cat package.json | jq -r '.version')
echo "PACKAGE_VERSION=$VER" >> $GITHUB_OUTPUT
- name: "👁️‍🗨️ Get Package Version › Print"
id: task_initialize_package_getversion_debug
# ---------------------------------------------------------------------------------------
# Package Version > Print (Debug)
# ---------------------------------------------------------------------------------------

- name: "👁️‍🗨️ Package Version › Print"
id: task_initialize_package_version_print
run: |
echo "VERSION: ${{ steps.task_initialize_package_getversion.outputs.PACKAGE_VERSION }}"
echo "VERSION: ${{ steps.task_initialize_package_version.outputs.PACKAGE_VERSION }}"
# ---------------------------------------------------------------------------------------
# Job > Release > Github
Expand Down Expand Up @@ -164,21 +188,25 @@ jobs:
npm run obs:generate
# ---------------------------------------------------------------------------------------
# Get guid and uuid from env variable
# generated by npm
# .ENV > Get
# Get guid and uuid from env variable generated by npm
# ---------------------------------------------------------------------------------------

- name: "🪪 .ENV › Get"
id: task_release_dotenv_get
uses: falti/dotenv-action@v1

# ---------------------------------------------------------------------------------------
# .ENV > Print (Debug)
# Show guid and uuid from env variable generated by npm
# ---------------------------------------------------------------------------------------

- name: "🪪 .ENV › Read"
id: task_dotenv_debug_print
run: |
echo "GUID: ${{ steps.task_release_dotenv_get.outputs.GUID }}"
echo "UUID: ${{ steps.task_release_dotenv_get.outputs.UUID }}"
# ---------------------------------------------------------------------------------------
# Build Project & Create Zip
# ---------------------------------------------------------------------------------------
Expand All @@ -193,7 +221,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.ADMINSERV_TOKEN_CL }}

- name: "🔨 Build › Release Candidate ( ${{ inputs.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}-rc.${{ inputs.VERSION_RC }}.zip )"
- name: "🔨 Build › RC ( ${{ inputs.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}-rc.${{ inputs.VERSION_RC }}.zip )"
id: task_release_build_rc
if: ${{ startsWith( inputs.PRERELEASE, true ) }}
run: |
Expand Down Expand Up @@ -223,6 +251,8 @@ jobs:

# ---------------------------------------------------------------------------------------
# [ Tag ]: Confirm
#
# check if tag already exists
# ---------------------------------------------------------------------------------------

- name: "🔖 Tag › Confirm ${{ env.PACKAGE_VERSION }}"
Expand All @@ -232,7 +262,7 @@ jobs:
echo "Tag already present: ${{ steps.task_release_tag_create.outputs.tag_exists }}"
# ---------------------------------------------------------------------------------------
# [ Release Candidate ]: Checksum
# Checksum > Generate
# ---------------------------------------------------------------------------------------

- name: "🆔 Checksum › Stable"
Expand All @@ -245,7 +275,7 @@ jobs:
echo "FILE_ZIP=${filename_zip}" >> $GITHUB_ENV
echo "SHA256SUM=${sha256}" >> $GITHUB_ENV
- name: "🆔 Checksum › Release Candidate"
- name: "🆔 Checksum › RC"
id: task_release_checksum_rc_set
if: ${{ startsWith( inputs.PRERELEASE, true ) }}
run: |
Expand All @@ -255,6 +285,10 @@ jobs:
echo "FILE_ZIP=${filename_zip}" >> $GITHUB_ENV
echo "SHA256SUM=${sha256}" >> $GITHUB_ENV
# ---------------------------------------------------------------------------------------
# Checksum > Print
# ---------------------------------------------------------------------------------------

- name: "🆔 Checksum › Print"
id: task_release_checksum_st_get
run: |
Expand All @@ -273,7 +307,7 @@ jobs:
avatarSize: 42

# ---------------------------------------------------------------------------------------
# [ ZIP ] : Stable
# Checksum > Add to ZIP file
# ---------------------------------------------------------------------------------------

- name: "📦 Zip › Add Checksum › Stable"
Expand All @@ -284,7 +318,7 @@ jobs:
zip -jr ${{ inputs.PLUGIN_NAME }}-${{ env.PACKAGE_VERSION }}.zip SHA256SUMS.txt
ls
- name: "📦 Zip › Add Checksum › Release Candidate"
- name: "📦 Zip › Add Checksum › RC"
id: task_release_zip_rc
if: ${{ startsWith( inputs.PRERELEASE, true ) }}
run: |
Expand All @@ -293,7 +327,7 @@ jobs:
ls
# ---------------------------------------------------------------------------------------
# Generate Changelog
# Changelog > Generate
#
# generates a changelog from the github api. requires a PREVIOUS_TAG in order to figure
# out the changes made between the two versions.
Expand Down Expand Up @@ -323,7 +357,7 @@ jobs:
fetchViaCommits: true
configurationJson: |
{
"template": "## Release Info <sup>(${{ steps.task_release_dotenv_get.outputs.UUID }})</sup>\n- <sub>**Version began on**: <sub>........</sub>`#{{FROM_TAG_DATE}}`</sub>\n- <sub>**SHA256**: <sub>................................</sub>`${{ env.SHA256SUM }} 🔺 ${{ env.FILE_ZIP }}`</sub>\n- <sub>**GUID**: <sub>.......................................</sub>`${{ steps.task_release_dotenv_get.outputs.GUID }}`</sub>\n- <sub>**UUID**: <sub>.......................................</sub>`${{ steps.task_release_dotenv_get.outputs.UUID }}`</sub>\n- <sub>**Stamp**: <sub>....................................</sub>`#{{FROM_TAG}}-#{{FROM_TAG_DATE}} 🔺 #{{TO_TAG}}-#{{TO_TAG_DATE}}`</sub>\n- <sub>**Last Release**: <sub>......................</sub>`#{{DAYS_SINCE}} days ago`</sub>\n\n<br>\n\n---\n\n<br>\n\n### What's New\nThis release contains the following changes:\n\n<br>\n\n---\n\n<br>\n\n### Statistics\nHow the files have changed:\n<ul><li><a href='#{{RELEASE_DIFF}}'>Changed files</a> : <b>#{{CHANGED_FILES}}</b> </li><li>Commits : <b>#{{COMMITS}}</b> </li><li>Additions : <b>#{{ADDITIONS}}</b></li><li>Deletions : <b>#{{DELETIONS}}</b></li>\n<br />\n</ul>\n\n<br>\n\n---\n\n<br>\n\n### Pull Requests\nThis release is associated with the following pull requests:\n#{{CHANGELOG}}\n\n<br>\n\n---\n\n<br>\n\n"
"template": "## Release Info <sup>(${{ steps.task_release_dotenv_get.outputs.UUID }})</sup>\n| Item | Value |\n| --- | --- |\n|<sub>SHA256</sub>|<sub>${{ env.SHA256SUM }} 🔺 ${{ env.FILE_ZIP }}</sub>|\n|<sub>GUID</sub>|<sub>`${{ steps.task_release_dotenv_get.outputs.GUID }}`</sub>|\n|<sub>UUID</sub>|<sub>`${{ steps.task_release_dotenv_get.outputs.UUID }}`</sub>|\n|<sub>Stamp</sub>|<sub>`#{{FROM_TAG}}-#{{FROM_TAG_DATE}} 🔺 #{{TO_TAG}}-#{{TO_TAG_DATE}}`</sub>|\n|<sub>Last Release</sub>|<sub>`#{{DAYS_SINCE}} days ago`</sub>|\n\n<br>\n\n---\n\n<br>\n\n### What's New\nThis release contains the following changes:\n\n<br>\n\n---\n\n<br>\n\n### Statistics\nHow the files have changed:\n<ul><li><a href='#{{RELEASE_DIFF}}'>Changed files</a> : <b>#{{CHANGED_FILES}}</b> </li><li>Commits : <b>#{{COMMITS}}</b> </li><li>Additions : <b>#{{ADDITIONS}}</b></li><li>Deletions : <b>#{{DELETIONS}}</b></li>\n<br />\n</ul>\n\n<br>\n\n---\n\n<br>\n\n### Pull Requests\nThis release is associated with the following pull requests:\n#{{CHANGELOG}}\n\n<br>\n\n---\n\n<br>\n\n"
}
env:
GITHUB_TOKEN: ${{ secrets.ADMINSERV_TOKEN }}
Expand All @@ -349,13 +383,13 @@ jobs:
fetchViaCommits: true
configurationJson: |
{
"template": "## Release Info <sup>(${{ steps.task_release_dotenv_get.outputs.UUID }})</sup>\n- <sub>**Version began on**: <sub>........</sub>`#{{FROM_TAG_DATE}}`</sub>\n- <sub>**SHA256**: <sub>................................</sub>`${{ env.SHA256SUM }} 🔺 ${{ env.FILE_ZIP }}`</sub>\n- <sub>**GUID**: <sub>.......................................</sub>`${{ steps.task_release_dotenv_get.outputs.GUID }}`</sub>\n- <sub>**UUID**: <sub>.......................................</sub>`${{ steps.task_release_dotenv_get.outputs.UUID }}`</sub>\n- <sub>**Stamp**: <sub>....................................</sub>`#{{FROM_TAG}}-#{{FROM_TAG_DATE}} 🔺 #{{TO_TAG}}-#{{TO_TAG_DATE}}`</sub>\n- <sub>**Last Release**: <sub>......................</sub>`#{{DAYS_SINCE}} days ago`\n</sup>\n\n<br>\n\n---\n\n<br>\n\n### What's New\nThis release contains the following changes:\n\n<br>\n\n---\n\n<br>\n\n### Statistics\nHow the files have changed:\n<ul><li><a href='#{{RELEASE_DIFF}}'>Changed files</a> : <b>#{{CHANGED_FILES}}</b> </li><li>Commits : <b>#{{COMMITS}}</b> </li><li>Additions : <b>#{{ADDITIONS}}</b></li><li>Deletions : <b>#{{DELETIONS}}</b></li>\n<br />\n</ul>\n\n<br>\n\n---\n\n<br>\n\n### Commits (#{{UNCATEGORIZED_COUNT}})\nThe following commits are uncategorized:\n#{{UNCATEGORIZED}}\n\n<br>\n\n---\n\n<br>\n\n### Pull Requests\nThis release is associated with the following pull requests:\n#{{CHANGELOG}}\n\n<br>\n\n---\n\n<br>\n\n"
"template": "## Release Info <sup>(${{ steps.task_release_dotenv_get.outputs.UUID }})</sup>\n| Item | Value |\n| --- | --- |\n|<sub>SHA256</sub>|<sub>${{ env.SHA256SUM }} 🔺 ${{ env.FILE_ZIP }}</sub>|\n|<sub>GUID</sub>|<sub>`${{ steps.task_release_dotenv_get.outputs.GUID }}`</sub>|\n|<sub>UUID</sub>|<sub>`${{ steps.task_release_dotenv_get.outputs.UUID }}`</sub>|\n|<sub>Stamp</sub>|<sub>`#{{FROM_TAG}}-#{{FROM_TAG_DATE}} 🔺 #{{TO_TAG}}-#{{TO_TAG_DATE}}`</sub>|\n|<sub>Last Release</sub>|<sub>`#{{DAYS_SINCE}} days ago`</sub>|\n\n<br>\n\n---\n\n<br>\n\n### What's New\nThis release contains the following changes:\n\n<br>\n\n---\n\n<br>\n\n### Statistics\nHow the files have changed:\n<ul><li><a href='#{{RELEASE_DIFF}}'>Changed files</a> : <b>#{{CHANGED_FILES}}</b> </li><li>Commits : <b>#{{COMMITS}}</b> </li><li>Additions : <b>#{{ADDITIONS}}</b></li><li>Deletions : <b>#{{DELETIONS}}</b></li>\n<br />\n</ul>\n\n<br>\n\n---\n\n<br>\n\n### Commits (#{{UNCATEGORIZED_COUNT}})\nThe following commits are uncategorized:\n#{{UNCATEGORIZED}}\n\n<br>\n\n---\n\n<br>\n\n### Pull Requests\nThis release is associated with the following pull requests:\n#{{CHANGELOG}}\n\n<br>\n\n---\n\n<br>\n\n"
}
env:
GITHUB_TOKEN: ${{ secrets.ADMINSERV_TOKEN }}

# ---------------------------------------------------------------------------------------
# Fetch Changelog
# Changelog > Fetch
# ---------------------------------------------------------------------------------------

- name: "📝 Changelog › Print (Categorized)"
Expand Down Expand Up @@ -398,7 +432,7 @@ jobs:
${{ steps.task_release_changelog_categorized.outputs.changelog }}
${{ steps.task_release_changelog_uncategorized.outputs.changelog }}
- name: "🏳️ Post › Release Candidate"
- name: "🏳️ Post › RC"
if: ${{ startsWith( inputs.PRERELEASE, true ) }}
uses: softprops/action-gh-release@v2
id: task_release_bundle_rc
Expand Down

0 comments on commit 949cfd0

Please sign in to comment.