Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
|
c9d77b1637 | ||
|
ec15115ef5 | ||
b5993081a8 |
5 changed files with 153 additions and 5 deletions
142
.github/workflows/release.yml
vendored
Normal file
142
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,142 @@
|
|||
name: Release package
|
||||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DC_TYPE: plugin
|
||||
DC_MIN: 2.32
|
||||
|
||||
# required to set secrets in
|
||||
# https://github.com/xxx/xxx/settings/secrets/actions
|
||||
# TELEGRAM_ID, TELEGRAM_TOKEN
|
||||
|
||||
jobs:
|
||||
check_release:
|
||||
if: (contains(github.event.head_commit.message, 'release') || (github.event_name != 'push'))
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.dotclear.outputs.version }}
|
||||
dcmin: ${{ steps.dotclear.outputs.dcmin }}
|
||||
exists: ${{ steps.repository.outputs.release-exists }}
|
||||
steps:
|
||||
- name: Checkout repository master branch
|
||||
uses: actions/checkout@master
|
||||
|
||||
# Parser from https://github.com/franck-paul
|
||||
- name: Run PHP code
|
||||
id: dotclear
|
||||
shell: php {0}
|
||||
run: |
|
||||
<?php
|
||||
$version = '';
|
||||
$dcmin = '${{ env.DC_MIN }}';
|
||||
$df = file_get_contents('./_define.php');
|
||||
if (preg_match('/registerModule\((.*?),(.*?)[\'\"],(.*?)[\'\"],(.*?)[\'\"](.*?)[\'\"](.*?)(,.*)\)/s',$df,$matches)) {
|
||||
if (isset($matches[5])) {
|
||||
$version = $matches[5];
|
||||
if (isset($matches[7])) {
|
||||
$str = $matches[7];
|
||||
if (preg_match('/\[(.*?)[\'\"]core[\'\"](.*?),(.*?)[\'\"](.*?)[\'\"](.*?)\]/s',$str,$submatches)) {
|
||||
$dcmin = $submatches[4];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
file_put_contents(getenv('GITHUB_OUTPUT'), "version=$version\n", FILE_APPEND);
|
||||
file_put_contents(getenv('GITHUB_OUTPUT'), "dcmin=$dcmin\n", FILE_APPEND);
|
||||
|
||||
- name: Check repository releases
|
||||
id: repository
|
||||
uses: insightsengineering/release-existence-action@v1.0.0
|
||||
with:
|
||||
release-tag: 'v${{ steps.dotclear.outputs.version }}'
|
||||
|
||||
do_release:
|
||||
needs: check_release
|
||||
if: needs.check_release.outputs.exists == 'false'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository master branch
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Get repository name
|
||||
id: repository
|
||||
uses: MariachiBear/get-repo-name-action@v1.1.0
|
||||
with:
|
||||
with-owner: 'false'
|
||||
|
||||
- name: Get download URL
|
||||
id: download
|
||||
run: |
|
||||
fulltag=${{ github.ref_name }}
|
||||
echo download-url="https://github.com/${{ github.repository }}/releases/download/v${{ needs.check_release.outputs.version }}/${{ env.DC_TYPE }}-${{ steps.repository.outputs.repository-name }}.zip" >> $GITHUB_OUTPUT
|
||||
|
||||
# Parser from https://github.com/franck-paul
|
||||
- name: Read dcstore
|
||||
id: readstore
|
||||
shell: php {0}
|
||||
run: |
|
||||
<?php
|
||||
if (file_exists('dcstore.xml')) {
|
||||
$ds = file_get_contents('dcstore.xml');
|
||||
if ($ds) {
|
||||
$ds = preg_replace('/<version>(.*?)<\/version>/s',"<version>${{ needs.check_release.outputs.version }}</version>",$ds);
|
||||
$ds = preg_replace('/<file>(.*?)<\/file>/s',"<file>${{ steps.download.outputs.download-url }}</file>",$ds);
|
||||
$ds = preg_replace('/<da:dcmin>(.*?)<\/da:dcmin>/s',"<da:dcmin>${{ needs.check_release.outputs.dcmin }}</da:dcmin>",$ds);
|
||||
if ($ds) {
|
||||
file_put_contents('dcstore.xml',$ds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- name: Write dcstore
|
||||
id: writestore
|
||||
shell: bash
|
||||
run: |
|
||||
test=$(git diff --name-only -- dcstore.xml)
|
||||
if [[ "$test" != "" ]]; then
|
||||
echo "dcstore.xml modified, need to be commit"
|
||||
git config user.name "${{ github.actor }}"
|
||||
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
|
||||
git add dcstore.xml
|
||||
git commit -m "Update dcstore.xml"
|
||||
git push
|
||||
else
|
||||
echo "dcstore.xml not modified"
|
||||
fi
|
||||
|
||||
- name: Create archive
|
||||
id: writearchive
|
||||
uses: thedoctor0/zip-release@0.7.6
|
||||
with:
|
||||
type: 'zip'
|
||||
directory: ..
|
||||
path: '${{ steps.repository.outputs.repository-name }}'
|
||||
filename: '${{ env.DC_TYPE }}-${{ steps.repository.outputs.repository-name }}.zip'
|
||||
exclusions: '*.git* /*node_modules/* .editorconfig'
|
||||
|
||||
- name: Create release with archive
|
||||
id: writerelease
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
artifacts: '../${{ env.DC_TYPE }}-${{ steps.repository.outputs.repository-name }}.zip'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit: master
|
||||
draft: false
|
||||
prerelease: false
|
||||
generateReleaseNotes: true
|
||||
name: ${{ steps.repository.outputs.repository-name }} ${{ needs.check_release.outputs.version }}
|
||||
tag: 'v${{ needs.check_release.outputs.version }}'
|
||||
|
||||
- name: Send Telegram Message Ok
|
||||
uses: appleboy/telegram-action@v1.0.0
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_ID }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
format: markdown
|
||||
message: |
|
||||
__Github workflow run__
|
||||
- Trigger: ${{ github.event_name }}
|
||||
- Release: ${{ steps.repository.outputs.repository-name }} ${{ needs.check_release.outputs.version }}
|
||||
- Download URL: ${{ steps.download.outputs.download-url }}
|
|
@ -1,3 +1,9 @@
|
|||
countdown 2.4.1 - 2023.10.123
|
||||
===========================================================
|
||||
* Require Dotclear 2.28
|
||||
* Require PHP 8.1
|
||||
* Fix repository branch
|
||||
|
||||
countdown 2.4 - 2023.10.15
|
||||
===========================================================
|
||||
* Require Dotclear 2.28
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# README
|
||||
|
||||
[![Release](https://img.shields.io/badge/release-2.4-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/countdown/releases)
|
||||
![Date](https://img.shields.io/badge/date-2023.10.15-c44d58.svg)
|
||||
[![Release](https://img.shields.io/badge/release-2.4.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/countdown/releases)
|
||||
![Date](https://img.shields.io/badge/date-2023.10.23-c44d58.svg)
|
||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download)
|
||||
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/countdown)
|
||||
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/countdown/src/branch/master/LICENSE)
|
||||
|
|
|
@ -18,7 +18,7 @@ $this->registerModule(
|
|||
'CountDown',
|
||||
'Countdown and stopwatch',
|
||||
'Moe (http://gniark.net/) and contributors',
|
||||
'2.4',
|
||||
'2.4.1',
|
||||
[
|
||||
'requires' => [['core', '2.28']],
|
||||
'permissions' => 'My',
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<modules xmlns:da="http://dotaddict.org/da/">
|
||||
<module id="countdown">
|
||||
<name>CountDown</name>
|
||||
<version>2.4</version>
|
||||
<version>2.4.1</version>
|
||||
<author>Moe (http://gniark.net/) and contributors</author>
|
||||
<desc>Countdown and stopwatch</desc>
|
||||
<file>https://git.dotclear.watch/JcDenis/countdown/releases/download/v2.4/plugin-countdown.zip</file>
|
||||
<file>https://github.com/JcDenis/countdown/releases/download/v2.4.1/plugin-countdown.zip</file>
|
||||
<da:dcmin>2.28</da:dcmin>
|
||||
<da:details>https://git.dotclear.watch/JcDenis/countdown/src/branch/master/README.md</da:details>
|
||||
<da:support>https://git.dotclear.watch/JcDenis/countdown/issues</da:support>
|
||||
|
|
Loading…
Reference in a new issue