...
This commit is contained in:
parent
fc5e30dda3
commit
643d1418ec
@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y chafa libglib2.0-dev
|
sudo apt-get install -y chafa libglib2.0-dev jq
|
||||||
|
|
||||||
- name: Build binary
|
- name: Build binary
|
||||||
run: make build
|
run: make build
|
||||||
@ -32,25 +32,22 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
tar -czvf gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz gogofetch Makefile logos/
|
tar -czvf gogofetch-${{ github.ref_name }}-linux-amd64.tar.gz gogofetch Makefile logos/
|
||||||
|
|
||||||
- name: Create Release and Upload Asset
|
- name: Create Release and Upload Asset via API
|
||||||
uses: actions/github-script@v7
|
run: |
|
||||||
with:
|
TAG="${{ github.ref_name }}"
|
||||||
script: |
|
REPO="${{ github.repository }}"
|
||||||
const fs = require('fs');
|
TOKEN="${{ secrets.GITHUB_TOKEN }}"
|
||||||
const assetName = `gogofetch-${context.ref.replace('refs/tags/', '')}-linux-amd64.tar.gz`;
|
ASSET="gogofetch-${TAG}-linux-amd64.tar.gz"
|
||||||
|
|
||||||
const release = await github.rest.repos.createRelease({
|
RELEASE_ID=$(curl -X POST "${{ github.server_url }}/api/v1/repos/${REPO}/releases" \
|
||||||
owner: context.repo.owner,
|
-H "Authorization: token ${TOKEN}" \
|
||||||
repo: context.repo.repo,
|
-H "Content-Type: application/json" \
|
||||||
tag_name: context.ref.replace('refs/tags/', ''),
|
-d "{\"tag_name\":\"${TAG}\",\"target_commitish\":\"master\",\"name\":\"Release ${TAG}\",\"body\":\"Automated binary release for Arch Linux AUR\",\"draft\":false,\"prerelease\":false}" \
|
||||||
name: `Release ${context.ref.replace('refs/tags/', '')}`,
|
| jq '.id')
|
||||||
body: "Automated binary release for Arch Linux AUR"
|
|
||||||
});
|
|
||||||
|
|
||||||
await github.rest.repos.uploadReleaseAsset({
|
echo "Created release with ID: ${RELEASE_ID}"
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
curl -X POST "${{ github.server_url }}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \
|
||||||
release_id: release.data.id,
|
-H "Authorization: token ${TOKEN}" \
|
||||||
name: assetName,
|
-H "Accept: application/json" \
|
||||||
data: fs.readFileSync(`./${assetName}`)
|
-F "attachment=@./${ASSET}"
|
||||||
});
|
|
||||||
Loading…
Reference in New Issue
Block a user