Skip to content

Commit

Permalink
cam18894 - ajout action pour generer le kpz a chaque push de tag
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasInlibro authored Jun 2, 2023
1 parent d741054 commit a091638
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/generate_kpz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Generate KPZ file

# Controls when the workflow will run
on:
# Triggers the workflow on new tags events but only for the "master" branch
push:
tags:
- '*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
release:
name: Build & Release
runs-on: ubuntu-latest
permissions: write-all
if: startsWith(github.ref, 'refs/tags/v')
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3

- name: Parse out and store the GitHub repository name
id: myvars
run: |
IFS='/' read -r -a parts <<< "$GITHUB_REPOSITORY"
GITHUB_REPO="${parts[1]}"
echo "github_repo=$GITHUB_REPO" >> $GITHUB_OUTPUT
echo "GITHUB REPO: $GITHUB_REPO"
TAG_VERSION="${GITHUB_REF##*/}"
echo "TAG VERSION: $TAG_VERSION"
TAG_VERSION="${TAG_VERSION:1}"
echo "TAG VERSION 2: $TAG_VERSION"
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Dump myvars outputs
env:
GITHUB_CONTEXT: ${{ toJson(steps.myvars.outputs) }}
run: echo "$GITHUB_CONTEXT"

- name: Build Koha Plugin kpz artifact
id: kpz
uses: "bywatersolutions/github-action-koha-plugin-create-kpz@master"
with:
release-version: ${{ steps.myvars.outputs.tag_version }}
release-name: ${{ steps.myvars.outputs.github_repo }}
minimum-version: "22.05"
plugin-module: "Koha/Plugin/UndeleteRecords.pm"

- name: See if kpz was created
run: |
echo "FILENAME: ${{ steps.kpz.outputs.filename }}"
ls -alh
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.kpz.outputs.filename }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a091638

Please sign in to comment.