|
| 1 | +name: "Publish release" |
1 | 2 |
|
2 | 3 | on: |
3 | 4 | push: |
4 | | - # Sequence of patterns matched against refs/tags |
5 | 5 | tags: |
6 | | - - '*.*.*' # Push events to matching ex:20.15.10 |
| 6 | + - '*' |
7 | 7 |
|
8 | | -name: Create release with tag |
9 | | -env: |
10 | | - TAG_VALUE: ${GITHUB_REF/refs\/tags\//} |
11 | 8 | jobs: |
12 | | - build: |
13 | | - name: Upload Release Asset |
14 | | - runs-on: ubuntu-latest |
15 | | - steps: |
16 | | - - name: Checkout code |
17 | | - uses: actions/checkout@v2 |
18 | | - - name: Build project # This would actually build your project, using zip for an example artifact |
19 | | - id: build_ |
20 | | - env: |
21 | | - GITHUB_NAME: ${{ github.event.repository.name }} |
22 | | - |
23 | | - |
24 | | - 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 jcvf glpi-$GITHUB_NAME-${GITHUB_REF/refs\/tags\//}.tar.bz2 $GITHUB_NAME;ls -al;echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//};echo ${{ steps.getxml.outputs.info }}; |
25 | | - # 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 |
26 | | - - name: Create Release |
27 | | - id: create_release |
28 | | - uses: actions/create-release@v1 |
29 | | - env: |
30 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
31 | | - with: |
32 | | - tag_name: ${{ github.ref }} |
33 | | - release_name: | |
34 | | - GLPI ${{ steps.build_.outputs.version_glpi }} : Version ${{ github.ref }} disponible / available |
35 | | - body : Version ${{ steps.build_.outputs.tag }} released for GLPI ${{ steps.build_.outputs.version_glpi }} |
36 | | - draft: false |
37 | | - prerelease: true |
38 | | - - name: Upload Release Asset |
39 | | - id: upload-release-asset |
40 | | - uses: actions/upload-release-asset@v1 |
41 | | - env: |
42 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
43 | | - GITHUB_NAME: ${{ github.event.repository.name }} |
44 | | - with: |
45 | | - 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 |
46 | | - asset_path: /home/runner/work/${{ github.event.repository.name }}/glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 |
47 | | - asset_name: glpi-${{ github.event.repository.name }}-${{ steps.build_.outputs.tag }}.tar.bz2 |
48 | | - asset_content_type: application/zip |
49 | | - |
| 9 | + publish-release: |
| 10 | + permissions: |
| 11 | + contents: "write" |
| 12 | + name: "Publish release" |
| 13 | + uses: "glpi-project/plugin-release-workflows/.github/workflows/publish-release.yml@v1" |
0 commit comments