up
Some checks reported errors
continuous-integration/drone/tag Build was killed

This commit is contained in:
root 2024-08-12 23:51:11 +02:00
parent 2f359da27a
commit 4235fd7961
No known key found for this signature in database
GPG Key ID: 4967812A078C3A4A
4 changed files with 55 additions and 11 deletions

View File

@ -14,20 +14,24 @@ trigger:
steps:
- name: build
environment:
PASSWORD:
from_secret: password
commands:
- npm ci
- vsce package
- name: gitea_release
image: plugins/gitea-release
settings:
base_url: https://gitea.raphaelpiccolo.com
files: "*.vsix"
api_key:
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- bash gitearelease.sh
# - name: gitea_release
# image: plugins/gitea-release
# settings:
# base_url: https://gitea.raphaelpiccolo.com
# files: "*.vsix"
# api_key:
# from_secret: gitea_token
# - name: deploy
# environment:

40
gitearelease.sh Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# Variables
# GITEA_TOKEN=""
# DRONE_TAG="1.1.6"
# DRONE_REPO_NAME="vscodestat"
# DRONE_REPO_OWNER="root"
GITEA_API_URL="https://gitea.raphaelpiccolo.com/api/v1"
TAG_NAME="v${DRONE_TAG}"
RELEASE_NAME="Release ${DRONE_TAG}"
RELEASE_BODY="vscode extension generated"
ARTIFACT_PATH="${DRONE_REPO_NAME}-${DRONE_TAG}.vsix"
# Create a release
response=$(curl -s -X POST "${GITEA_API_URL}/repos/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"${TAG_NAME}\",
\"name\": \"${RELEASE_NAME}\",
\"body\": \"${RELEASE_BODY}\",
\"draft\": false,
\"prerelease\": false
}")
# Extract release ID from the response
release_id=$(echo $response | jq '.id')
if [ -z "$release_id" ]; then
echo "Failed to create release"
exit 1
fi
# Upload the artifact
curl -s -X POST "${GITEA_API_URL}/repos/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/releases/${release_id}/assets?name=$(basename ${ARTIFACT_PATH})" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: $(file -b --mime-type ${ARTIFACT_PATH})" \
--data-binary @"${ARTIFACT_PATH}"
echo "Artifact uploaded successfully."

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "vscodestat",
"version": "1.1.6",
"version": "1.1.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "vscodestat",
"version": "1.1.6",
"version": "1.1.7",
"license": "ISC",
"devDependencies": {
"@types/mocha": "^10.0.7",

View File

@ -1,7 +1,7 @@
{
"name": "vscodestat",
"displayName": "vscodestat",
"version": "1.1.6",
"version": "1.1.7",
"description": "",
"categories": [
"Other"