From 458c13cf537a977361dc8e26f56363d586ba0a0b Mon Sep 17 00:00:00 2001 From: minzords Date: Fri, 9 Aug 2024 13:44:18 +0200 Subject: [PATCH 1/3] fix; mo build fix: generete on all branch fix: allow manual fix: Generate mo Signed-off-by: CI bot fix: migrate ci feat: migrate release workflow fix: release command fix: directory fix: directory --- .github/workflows/generatemo.yml | 38 +++++++++-------- .github/workflows/release.yml | 68 +++++++++++++------------------ .github/workflows/updatepot.yml | 26 ++++++------ locales/en_GB.mo | Bin 2960 -> 2919 bytes locales/fr_FR.mo | Bin 3681 -> 3640 bytes 5 files changed, 64 insertions(+), 68 deletions(-) diff --git a/.github/workflows/generatemo.yml b/.github/workflows/generatemo.yml index 79e214a..4141a44 100644 --- a/.github/workflows/generatemo.yml +++ b/.github/workflows/generatemo.yml @@ -1,37 +1,41 @@ name: Generate MO on: push: - branches: [ main ] paths: - '**.po' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + workflow_dispatch: + jobs: run: - name: Generate mo runs-on: ubuntu-latest steps: - - name: Checkout repo - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Perl environment - # You may pin to the exact commit or the version. - # uses: shogo82148/actions-setup-perl@8d2e3d59a9516b785ed32169d48a4888eaa9b514 - uses: shogo82148/actions-setup-perl@v1.7.2 - - name: msgfmt - # You may pin to the exact commit or the version. - # uses: whtsky/msgfmt-action@6b2181f051b002182d01a1e1f1aff216230c5a4d - uses: whtsky/msgfmt-action@20190305 + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: '5.38' + + - name: Install dependencies + run: sudo apt install gettext + - name: Generate mo run: perl tools/update_mo.pl; - name: Commit changes - uses: EndBug/add-and-commit@v5.1.0 + uses: EndBug/add-and-commit@v9 with: - + author_name: CI bot + author_email: adminsys@itsm-ng.com + commit: --signoff + default_author: github_actor message: "Generate mo" + - name: Push changes - - uses: actions-go/push@v1 + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0a0467..c962d15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,49 +1,39 @@ +name: Release workflow on: push: - # Sequence of patterns matched against refs/tags tags: - - '*.*.*' # Push events to matching ex:20.15.10 + - '*' + +permissions: + contents: write -name: Create release with tag -env: - TAG_VALUE: ${GITHUB_REF/refs\/tags\//} jobs: - build: - name: Upload Release Asset + release: + name: Release on GitHub runs-on: ubuntu-latest - steps: + steps: - name: Checkout code - uses: actions/checkout@v2 - - name: Build project # This would actually build your project, using zip for an example artifact - id: build_ - env: - GITHUB_NAME: ${{ github.event.repository.name }} - - - run: sudo apt-get install libxml-xpath-perl;echo $(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml);echo ::set-output name=version_glpi::$(xpath -e '/root/versions/version[num="'${GITHUB_REF/refs\/tags\//}'"]/compatibility/text()' $GITHUB_NAME.xml); rm -rf $GITHUB_NAME.xml tools wiki screenshots test .git .github ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png;cd ..; tar -zcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.gz $GITHUB_NAME;ls -al;echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//};echo ${{ steps.getxml.outputs.info }}; - # run: rm -rf $GITHUB_NAME.xml tools wiki screenshots test ISSUE_TEMPLATE.md TODO.txt $GITHUB_NAME.png; tar -zcvf glpi-$GITHUB_NAME-$GITHUB_TAG.tar.gz $GITHUB_NAME - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: actions/checkout@v4 + + - name: Build project + run: | + cd /home/runner/work/purchaserequest/ + rm -r purchaserequest/tools + tar -zcvf purchaserequest-${{ github.ref_name }}.tgz purchaserequest + + - name: Upload release + uses: actions/upload-artifact@v4 with: - tag_name: ${{ github.ref }} - release_name: | - GLPI ${{ steps.build_.outputs.version_glpi }} : Version ${{ github.ref }} disponible / available - body : Version ${{ steps.build_.outputs.tag }} released for GLPI ${{ steps.build_.outputs.version_glpi }} - draft: false - prerelease: true - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_NAME: ${{ github.event.repository.name }} + name: purchaserequest-${{ github.ref_name }}.tgz + path: /home/runner/work/purchaserequest/purchaserequest-${{ github.ref_name }}.tgz + + - name: Create release + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: /home/runner/work/${{ github.event.repository.name }}/glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.gz - asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.gz - asset_content_type: application/zip - + files: /home/runner/work/purchaserequest/purchaserequest-${{ github.ref_name }}.tgz + body: "New release is available" + name: Purchase Request ${{ github.ref_name }} + draft: true + generate_release_notes: true + \ No newline at end of file diff --git a/.github/workflows/updatepot.yml b/.github/workflows/updatepot.yml index ccf26ab..7012325 100644 --- a/.github/workflows/updatepot.yml +++ b/.github/workflows/updatepot.yml @@ -4,31 +4,33 @@ on: branches: [ main ] paths-ignore: - 'locales/**' + workflow_dispatch: -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: run: - - name: Update POT - + name: Update POT runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v2 - name: install xgettext - run: sudo apt-get install gettext; + - name: Update POT run: sh tools/extract_template.sh; - - name: Commit changes - uses: EndBug/add-and-commit@v5.1.0 + uses: EndBug/add-and-commit@v9 with: - message: "Update POT" + author_name: CI bot + author_email: adminsys@itsm-ng.com + commit: --signoff + default_author: github_actor + message: "Generate POT" + - name: Push changes - - uses: actions-go/push@v1 - + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} diff --git a/locales/en_GB.mo b/locales/en_GB.mo index 0e690a56be9ba666c08b2c10f8556ce77e6119be..e8b8b5c9ccf619d675542b6473a06031e2d81476 100644 GIT binary patch delta 281 zcmXZWEepa>6vpv08FL#7;$*}37etuBPv8eoFdJ8lW*1#D*!%!%qFGqeE(4>%XtY|E zEdIv^m-D;lxtzm2I3N2mRDw_u@iY-fM1DmP8!cU=gJZ1W9Mjyx5pIwpAtil3VFj;f z;Un+gnC|^z4|OBk>*9cZW=J4)E^C4|?l2uVViRw9{>t+NC*)-_`^Xfl^eg1=;v+}4 flosx>i)Sq19sBsiB_<|Q4K9nwE%<5_Yq9zVpi>>H delta 320 zcmXZWu}cDB7{~F)IP5eB(NHe)I^{TsIC(uK;c%PQ> diff --git a/locales/fr_FR.mo b/locales/fr_FR.mo index 8540bb5a346d12aa9e0996ad6062a7419430fdc2..ec985bb0424b9b4ed5edbe5614968f996d2c72aa 100644 GIT binary patch delta 353 zcmXZXu}eZx6vy$OiJ0j_B{9*bJTq)65OH*Ka8m^T1tF-xq4`ZtP7zV7n=K)@*d(;L zI0`K-F8%{X1TB6~3YYu2_uO;uxo7Rp+{tag9|fdsSjtLziby$}AR#TWh%0pQ2lIG( zB6(QBbL^ny-D47;F@vvI!VgU0=HMU3*(aj%{}a5ZbU~nj*LZ_ve8DrEqlcep5C5VS zOvd&ftD>E^(c*oyh92<>-_YLsLWY8ll*WY9l344K$vUnfpHm&J(Y6ougvVTl?;5JW{+ooGm-BfCjJve<|sq|!ng5g|nc!4C{+#3DbyLa?;( zCy0*odW_U?Yg65_~7g7W?cy%-*^8*8lKt_G9&znDi5u#w0!VN#ppAMEb=v z{-KXk{n7+3qQNbk##40Xu5b{aa1>v02ET9!Q;CilOi>pTs<#i62r>i*IFA>Y#b+GB zPc*23PUAGX3nO%cZKJ`HZhnbwp$D}1hOVENY`4%H4pSGCYZBjD=jAruL59^Xx=oL9 z63>wtbdB!E`)=OEP3muS7p^w$dd|G;hFz{!%C)_tL%UM0RU(rMa-j_tY?wD;A<7qK L1D?iGZ_E1!ZVWDv From 2d112982049a95b6258b48e712af01b5496b81b7 Mon Sep 17 00:00:00 2001 From: minzords Date: Fri, 9 Aug 2024 14:10:35 +0200 Subject: [PATCH 2/3] fix: remove necessary folder --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c962d15..f946c65 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Build project run: | cd /home/runner/work/purchaserequest/ - rm -r purchaserequest/tools + rm -r purchaserequest/tools purchaserequest/.git purchaserequest/.github tar -zcvf purchaserequest-${{ github.ref_name }}.tgz purchaserequest - name: Upload release From f729003e0eb8dcb3be43dbe097c9d42ae4113cdf Mon Sep 17 00:00:00 2001 From: minzords Date: Fri, 9 Aug 2024 14:15:05 +0200 Subject: [PATCH 3/3] feat: clean --- README.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index b8884a0..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# purchaserequest -Plugin purchaserequest for GLPI - -Plugin extension for Order plugin (https://github.com/pluginsGLPI/order)