v2: ci updates

Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
2024-11-23 16:17:21 +03:30
parent 8d2bdaf352
commit 01e0904fa6
4 changed files with 109 additions and 13 deletions
+42 -13
View File
@@ -21,25 +21,54 @@ jobs:
with:
token: ${{ gitea.token }}
path: ./
- name: install tea cli and init
run: |
mkdir tmp && cd tmp
wget https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz
apt install xz-utils -y
xz -d tea-main-linux-amd64.xz
mv tea-main-linux-amd64 tea
export PATH=$PATH:$(pwd)/tea
cd ..
tea login \
--name ${{ gitea.server_url }} \
--token ${{ secrets.PROD_REG_TOKEN }} \
--url ${{ gitea.server_url }}
- run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
- run: npm install --save @bufbuild/protobuf @bufbuild/protoc-gen-es @bufbuild/buf
- run: buf --version
- run: "export PATH=$PATH:./node_modules/.bin\nbuf generate \n"
- run: |
if [ -n ${{ gitea.ref_name }} ]; then
mkdir .res
- name: tar files
run: |
for out in go ts doc; do
echo releasing ${out} ...
tar czf .res/${out}.tar.gz ./stub/${out}/
curl -Ss --user ${{ gitea.actor}}:${{ gitea.token}}\
--upload-file .res/${out}.tar.gz \
${{ gitea.server_url }}/api/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/${out}.tar.gz
done
echo releasing proto ...
tar czf ./.res/src.tar.gz $(find -type f -name "*.proto")
curl -Ss --user ${{ gitea.actor}}:${{ gitea.token}}\
--upload-file ./.res/src.tar.gz \
${{ gitea.server_url }}/api/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/src.tar.gz
fi
tar czf ./.res/src.tar.gz $(find -type f -name "*.proto")
tea r c \
--title "${{ gitea.ref_name }}" \
--tag "${{ gitea.ref_name }}" \
-a ./.res/src.tar.gz \
-a ./.res/go.tar.gz \
-a ./.res/doc.tar.gz \
-a ./.res/ts.tar.gz \
# - run: |
# if [ -n ${{ gitea.ref_name }} ]; then
# mkdir .res
# for out in go ts doc; do
# echo releasing ${out} ...
# tar czf .res/${out}.tar.gz ./stub/${out}/
# curl -Ss --user nfel:${{ secrets.PROD_REG_TOKEN }}\
# --upload-file .res/${out}.tar.gz \
# ${{ gitea.server_url }}/api/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/${out}.tar.gz
# done
# echo releasing proto ...
# tar czf ./.res/src.tar.gz $(find -type f -name "*.proto")
# curl -Ss --user nfel:${{ secrets.PROD_REG_TOKEN }}\
# --upload-file ./.res/src.tar.gz \
# ${{ gitea.server_url }}/api/packages/Kahroba/generic/proto/${{ gitea.ref_name }}/src.tar.gz
# fi
# - run: |