.github/workflows/upapp.yml #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
jobs: | |
uabuild: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run a multi-line script | |
run: | | |
#proj | |
name=`cat debian/changelog | head -1 | grep -o ^[^\ ]*` | |
#get up_url | |
wget https://github.com/colin-i/test/releases/download/1.5/${name} -O 1.txt | |
echo "up_url=`cat 1.txt`" >> $GITHUB_ENV | |
#get appimage artifact | |
id=$(gh run list --workflow=appimage.yml -b $(git rev-parse --abbrev-ref HEAD) | cut -f7 | head -1) | |
repo_at_gh=`cat debian/control | grep "^Homepage" | grep -o [^/]*$` | |
# | |
url=`gh api -H "Accept: application/vnd.github.v3+json" /repos/colin-i/${repo_at_gh}/actions/runs/${id}/artifacts | jq ".artifacts[0].archive_download_url"` | |
url=${url:1:-1} | |
echo ${url} | |
curl -L -H "Authorization: token ${{ secrets.PAT }}" ${url} --output a.zip | |
#to env | |
unzip ./a.zip | |
glibc=`cat version` | |
echo "file=${name}.AppImage" >> $GITHUB_ENV | |
echo "fullfile=${name}.glibc${glibc}.amd64.AppImage" >> $GITHUB_ENV | |
env: | |
#for gh | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
upload_url: ${{ env.up_url }} | |
asset_path: ./${{ env.file }} | |
asset_name: ${{ env.fullfile }} | |
asset_content_type: application/x-executable |