Test upload releasegithub
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 19s

This commit is contained in:
Clément CHABANNE 2024-06-09 01:45:45 +02:00
parent e8fa4b9263
commit 71ad1534c5

View File

@ -20,21 +20,49 @@ jobs:
- name: Install dependencies
run: |
apt update
apt install tree zip wget -y
apt install tree zip wget jq -y
- name: List files in the repository
run: tree ${{ gitea.workspace }}
- name: Build
run : |
echo "Compilation step in progress"
zip -rv go2ticket-chrome.zip src/*
cp go2ticket-chrome.zip go2ticket-firefox.xpi
zip -rv go2ticket-firefox.zip src/*
cp go2ticket-firefox.zip go2ticket-firefox.xpi
wget https://github.com/mcuadros/go-crxmake/releases/download/v0.2.0/crxmake_v0.2.0_linux_amd64.tar.gz
tar -xvzf crxmake_v0.2.0_linux_amd64.tar.gz crxmake_v0.2.0_linux_amd64/crxmake
./crxmake_v0.2.0_linux_amd64/crxmake src/ go2ticket-chrome.crx
ls -l go2ticket-*
- name: Deploy release
if: ${{ gitea.ref == 'refs/heads/master' }}
id: create_release
run: |
echo "Deploy artifacts on Gitea server"
curl -X POST -H "Authorization: token ${{ secrets.GIT_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ gitea.ref }}",
"target_commitish": "${{ gitea.sha }}",
"name": "${{ gitea.ref }}",
"body": "Release description",
"draft": true,
"prerelease": false
}' \
"${{ vars.GIT_URL }}/api/v1/repos/${{ gitea.repository }}/releases"
RELEASE_ID=$(curl -H "Authorization: token ${{ secrets.GIT_TOKEN }}" \
-H "Content-Type: application/json" \
"${{ vars.GIT_URL }}/api/v1/repos/${{ gitea.repository }}/releases/tags/${{ gitea.ref }}" \
| jq '.id')
curl -X POST -H "Authorization: token ${{ secrets.GIT_TOKEN }}" \
-H "Content-Type: multipart/form-data" \
-F "attachment=@go2ticket-firefox.xpi" \
"${{ vars.GIT_URL }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets"
curl -X POST -H "Authorization: token ${{ secrets.GIT_TOKEN }}" \
-H "Content-Type: multipart/form-data" \
-F "attachment=@go2ticket-chrome.crx" \
"${{ vars.GIT_URL }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets"
- name: Job's status
run: echo "🍏 This job's status is ${{ job.status }}."