Updated workflow
This commit is contained in:
@@ -10,28 +10,36 @@ jobs:
|
|||||||
runs-on: native
|
runs-on: native
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
git clone "$GITEA_SERVER_URL/$GITEA_REPO.git" repo
|
||||||
|
cd repo && git checkout "$GITEA_REF_NAME"
|
||||||
|
env:
|
||||||
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||||
|
GITEA_REPO: ${{ gitea.repository }}
|
||||||
|
GITEA_REF_NAME: ${{ gitea.ref_name }}
|
||||||
|
|
||||||
- name: Build zip
|
- name: Build zip
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
$version = $env:GITHUB_REF_NAME
|
cd repo
|
||||||
$zip = "SharePoint_ToolBox_${version}.zip"
|
VERSION="${{ gitea.ref_name }}"
|
||||||
Compress-Archive -Force -Path Sharepoint_ToolBox.ps1, lang -DestinationPath $zip
|
ZIP="SharePoint_ToolBox_${VERSION}.zip"
|
||||||
"ZIP=$zip" >> $env:GITHUB_ENV
|
zip -r "../${ZIP}" Sharepoint_ToolBox.ps1 lang/
|
||||||
"VERSION=$version" >> $env:GITHUB_ENV
|
echo "ZIP=${ZIP}" >> "$GITHUB_ENV"
|
||||||
|
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Create release and upload asset
|
- name: Create release
|
||||||
uses: https://gitea.com/actions/gitea-release-action@latest
|
run: |
|
||||||
with:
|
RELEASE_ID=$(curl -sf -X POST \
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases" \
|
||||||
tag_name: ${{ env.VERSION }}
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
release_name: "SharePoint ToolBox ${{ env.VERSION }}"
|
-H "Content-Type: application/json" \
|
||||||
body: |
|
-d "{\"tag_name\":\"${{ env.VERSION }}\",\"name\":\"SharePoint ToolBox ${{ env.VERSION }}\",\"body\":\"### Installation\\n1. Télécharger et extraire le zip\\n2. Lancer Sharepoint_ToolBox.ps1 avec PowerShell\\n3. Prérequis : Install-Module PnP.PowerShell\"}" \
|
||||||
## SharePoint ToolBox ${{ env.VERSION }}
|
| python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
|
echo "RELEASE_ID=${RELEASE_ID}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
### Installation
|
- name: Upload asset
|
||||||
1. Télécharger et extraire le zip
|
run: |
|
||||||
2. Lancer `Sharepoint_ToolBox.ps1` avec PowerShell
|
curl -sf -X POST \
|
||||||
3. Prérequis : module `PnP.PowerShell` (`Install-Module PnP.PowerShell`)
|
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${{ env.RELEASE_ID }}/assets" \
|
||||||
files: ${{ env.ZIP }}
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-F "attachment=@${{ env.ZIP }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user