diff --git a/.drone.yml b/.drone.yml index 5ab7ffe..ea818b4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,8 +6,19 @@ steps: - name: generate image: golang:1.19-alpine commands: - - apk add --no-cache curl libidn sipcalc gawk git patch bash python3 + - apk add --no-cache curl grep libidn sipcalc gawk git patch bash python3 - bash generate.sh +- name: create release tag + image: alpine:latest + environment: + GITEA_API_KEY: + from_secret: gitea_api_key + commands: + - apk add --no-cache curl + - sh tag.sh + when: + branch: + - master - name: release image: plugins/gitea-release settings: @@ -18,8 +29,8 @@ steps: checksum: - sha256 when: - branch: - - master + event: + - tag trigger: event: diff --git a/tag.sh b/tag.sh new file mode 100755 index 0000000..0f5055f --- /dev/null +++ b/tag.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -eux +export VERSION=`date +'%Y-%m-%d %R:%S'` +curl -X 'POST' \ + 'https://gitea.neur0tx.site/api/v1/repos/xray-addons/geoip-geosite-with-ru-blocklist/tags' \ + -H 'accept: application/json' \ + -H 'Authorization: GITEA_API_KEY' \ + -H 'Content-Type: application/json' \ + -d '{ + "message": "'"$VERSION"': daily release from ci", + "tag_name": "'"$VERSION"'", + "target": "master" +}' \ No newline at end of file