Skip to content

Commit

Permalink
Add required permissions to plugin release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Feb 20, 2024
1 parent cd63278 commit 359fcb8
Showing 1 changed file with 6 additions and 33 deletions.
39 changes: 6 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,13 @@
name: "Plugin release"
name: "Publish release"

on:
push:
tags:
- '*'

jobs:
create-release:
name: "Create release"
runs-on: "ubuntu-latest"
steps:
- name: "Extract tag name"
run: |
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Build package"
id: "build-package"
uses: "glpi-project/tools/github-actions/[email protected]"
with:
plugin-version: ${{ env.tag_name }}
- name: "Create release"
id: "create-release"
uses: "actions/create-release@v1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.tag_name }}
release_name: ${{ env.tag_name }}
draft: true
- name: "Attach package to release"
uses: "actions/upload-release-asset@v1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.build-package.outputs.package-path }}
asset_name: ${{ steps.build-package.outputs.package-basename }}
asset_content_type: " application/x-bzip2"
publish-release:
permissions:
contents: "write"
name: "Publish release"
uses: "glpi-project/plugin-release-workflows/.github/workflows/publish-release.yml@v1"

0 comments on commit 359fcb8

Please sign in to comment.