This commit is contained in:
parent
2f359da27a
commit
4235fd7961
20
.drone.yml
20
.drone.yml
@ -14,20 +14,24 @@ trigger:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
environment:
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: password
|
|
||||||
commands:
|
commands:
|
||||||
- npm ci
|
- npm ci
|
||||||
- vsce package
|
- vsce package
|
||||||
|
|
||||||
- name: gitea_release
|
- name: gitea_release
|
||||||
image: plugins/gitea-release
|
environment:
|
||||||
settings:
|
GITEA_TOKEN:
|
||||||
base_url: https://gitea.raphaelpiccolo.com
|
|
||||||
files: "*.vsix"
|
|
||||||
api_key:
|
|
||||||
from_secret: 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
|
# - name: deploy
|
||||||
# environment:
|
# environment:
|
||||||
|
40
gitearelease.sh
Normal file
40
gitearelease.sh
Normal 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
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "vscodestat",
|
"name": "vscodestat",
|
||||||
"version": "1.1.6",
|
"version": "1.1.7",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "vscodestat",
|
"name": "vscodestat",
|
||||||
"version": "1.1.6",
|
"version": "1.1.7",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/mocha": "^10.0.7",
|
"@types/mocha": "^10.0.7",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "vscodestat",
|
"name": "vscodestat",
|
||||||
"displayName": "vscodestat",
|
"displayName": "vscodestat",
|
||||||
"version": "1.1.6",
|
"version": "1.1.7",
|
||||||
"description": "",
|
"description": "",
|
||||||
"categories": [
|
"categories": [
|
||||||
"Other"
|
"Other"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user