mirror of
https://github.com/YunoHost-Apps/dex_ynh.git
synced 2024-09-03 18:26:22 +02:00
commit
f14d65c6cc
9 changed files with 58 additions and 48 deletions
46
.github/workflows/updater.sh
vendored
46
.github/workflows/updater.sh
vendored
|
@ -9,8 +9,6 @@
|
||||||
# Since each app is different, maintainers can adapt its contents so as to perform
|
# Since each app is different, maintainers can adapt its contents so as to perform
|
||||||
# automatic actions when a new upstream release is detected.
|
# automatic actions when a new upstream release is detected.
|
||||||
|
|
||||||
# Remove this exit command when you are ready to run this Action
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FETCHING LATEST RELEASE AND ITS ASSETS
|
# FETCHING LATEST RELEASE AND ITS ASSETS
|
||||||
|
@ -54,31 +52,8 @@ echo "${#assets[@]} available asset(s)"
|
||||||
# UPDATE SOURCE FILES
|
# UPDATE SOURCE FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Here we use the $assets variable to get the resources published in the upstream release.
|
src="app"
|
||||||
# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like.
|
asset_url="https://github.com/dexidp/dex/archive/refs/tags/v${version}.tar.gz"
|
||||||
|
|
||||||
# Let's loop over the array of assets URLs
|
|
||||||
for asset_url in ${assets[@]}; do
|
|
||||||
|
|
||||||
echo "Handling asset at $asset_url"
|
|
||||||
|
|
||||||
# Assign the asset to a source file in conf/ directory
|
|
||||||
# Here we base the source file name upon a unique keyword in the assets url (admin vs. update)
|
|
||||||
# Leave $src empty to ignore the asset
|
|
||||||
case $asset_url in
|
|
||||||
*"admin"*)
|
|
||||||
src="app"
|
|
||||||
;;
|
|
||||||
*"update"*)
|
|
||||||
src="app-upgrade"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
src=""
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# If $src is not empty, let's process the asset
|
|
||||||
if [ ! -z "$src" ]; then
|
|
||||||
|
|
||||||
# Create the temporary directory
|
# Create the temporary directory
|
||||||
tempdir="$(mktemp -d)"
|
tempdir="$(mktemp -d)"
|
||||||
|
@ -91,30 +66,17 @@ checksum=$(sha256sum "$tempdir/$filename" | head -c 64)
|
||||||
# Delete temporary directory
|
# Delete temporary directory
|
||||||
rm -rf $tempdir
|
rm -rf $tempdir
|
||||||
|
|
||||||
# Get extension
|
|
||||||
if [[ $filename == *.tar.gz ]]; then
|
|
||||||
extension=tar.gz
|
|
||||||
else
|
|
||||||
extension=${filename##*.}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Rewrite source file
|
# Rewrite source file
|
||||||
cat <<EOT > conf/$src.src
|
cat <<EOT > conf/$src.src
|
||||||
SOURCE_URL=$asset_url
|
SOURCE_URL=$asset_url
|
||||||
SOURCE_SUM=$checksum
|
SOURCE_SUM=$checksum
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=$extension
|
SOURCE_FORMAT=tar.gz
|
||||||
|
SOURCE_EXTRACT=true
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
SOURCE_FILENAME=
|
|
||||||
EOT
|
EOT
|
||||||
echo "... conf/$src.src updated"
|
echo "... conf/$src.src updated"
|
||||||
|
|
||||||
else
|
|
||||||
echo "... asset ignored"
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPDATE STEPS
|
# SPECIFIC UPDATE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
49
.github/workflows/updater.yml
vendored
Normal file
49
.github/workflows/updater.yml
vendored
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected.
|
||||||
|
# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization.
|
||||||
|
# This file should be enough by itself, but feel free to tune it to your needs.
|
||||||
|
# It calls updater.sh, which is where you should put the app-specific update steps.
|
||||||
|
name: Check for new upstream releases
|
||||||
|
on:
|
||||||
|
# Allow to manually trigger the workflow
|
||||||
|
workflow_dispatch:
|
||||||
|
# Run it every day at 6:00 UTC
|
||||||
|
schedule:
|
||||||
|
- cron: '0 6 * * *'
|
||||||
|
jobs:
|
||||||
|
updater:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fetch the source code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Run the updater script
|
||||||
|
id: run_updater
|
||||||
|
run: |
|
||||||
|
# Setting up Git user
|
||||||
|
git config --global user.name 'yunohost-bot'
|
||||||
|
git config --global user.email 'yunohost-bot@users.noreply.github.com'
|
||||||
|
# Run the updater script
|
||||||
|
/bin/bash .github/workflows/updater.sh
|
||||||
|
- name: Commit changes
|
||||||
|
id: commit
|
||||||
|
if: ${{ env.PROCEED == 'true' }}
|
||||||
|
run: |
|
||||||
|
git commit -am "Upgrade to v$VERSION"
|
||||||
|
- name: Create Pull Request
|
||||||
|
id: cpr
|
||||||
|
if: ${{ env.PROCEED == 'true' }}
|
||||||
|
uses: peter-evans/create-pull-request@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
commit-message: Update to version ${{ env.VERSION }}
|
||||||
|
committer: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
|
||||||
|
author: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
|
||||||
|
signoff: false
|
||||||
|
base: testing
|
||||||
|
branch: ci-auto-update-v${{ env.VERSION }}
|
||||||
|
delete-branch: true
|
||||||
|
title: 'Upgrade to version ${{ env.VERSION }}'
|
||||||
|
body: |
|
||||||
|
Upgrade to v${{ env.VERSION }}
|
||||||
|
draft: false
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
*~
|
*~
|
||||||
*.sw[op]
|
*.sw[op]
|
||||||
|
*.DS_Store
|
|
@ -29,7 +29,6 @@ This Yunohost package will install Dex and setup a canonical OpenID Connect prov
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
![Screenshot of Dex](./doc/screenshots/.DS_Store)
|
|
||||||
![Screenshot of Dex](./doc/screenshots/Dex_screenshot.png)
|
![Screenshot of Dex](./doc/screenshots/Dex_screenshot.png)
|
||||||
|
|
||||||
## Disclaimers / important information
|
## Disclaimers / important information
|
||||||
|
|
|
@ -29,7 +29,6 @@ This Yunohost package will install Dex and setup a canonical OpenID Connect prov
|
||||||
|
|
||||||
## Captures d'écran
|
## Captures d'écran
|
||||||
|
|
||||||
![Capture d'écran de Dex](./doc/screenshots/.DS_Store)
|
|
||||||
![Capture d'écran de Dex](./doc/screenshots/Dex_screenshot.png)
|
![Capture d'écran de Dex](./doc/screenshots/Dex_screenshot.png)
|
||||||
|
|
||||||
## Avertissements / informations importantes
|
## Avertissements / informations importantes
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/dexidp/dex/archive/refs/tags/v2.34.0.tar.gz
|
SOURCE_URL=https://github.com/dexidp/dex/archive/refs/tags/v2.35.0.tar.gz
|
||||||
SOURCE_SUM=39ea91dcd224604bf2a1e2e6918bc66a2f57ce76929e04745b48a4a8f6260e36
|
SOURCE_SUM=7ca7667549186f2cda1dab6d5e487f83f57f255083255c715e510ae4a1e7e063
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_EXTRACT=true
|
SOURCE_EXTRACT=true
|
||||||
|
|
BIN
doc/screenshots/.DS_Store
vendored
BIN
doc/screenshots/.DS_Store
vendored
Binary file not shown.
|
@ -5,7 +5,7 @@
|
||||||
"description": {
|
"description": {
|
||||||
"en": "OpenID Connect Provider based on Yunohost LDAP server"
|
"en": "OpenID Connect Provider based on Yunohost LDAP server"
|
||||||
},
|
},
|
||||||
"version": "2.34.0~ynh1",
|
"version": "2.35.0~ynh1",
|
||||||
"url": "https://github.com/YunoHost-Apps/dex_ynh",
|
"url": "https://github.com/YunoHost-Apps/dex_ynh",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
|
|
||||||
GO_VERSION="1.17"
|
GO_VERSION="1.19"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
Loading…
Reference in a new issue