55 types : [published]
66
77jobs :
8-
98 build :
109 runs-on : ubuntu-latest
1110 steps :
@@ -24,14 +23,16 @@ jobs:
2423 sudo apt-get install -y dos2unix
2524 - name : Convert line endings to LF (Unix format)
2625 run : find . -type f -exec dos2unix {} \;
27- - name : Parse the tag
28- id : parse-tag
29- run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
26+ - name : Parse the repository metadata
27+ id : repository-metadata
28+ run : |
29+ echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
30+ echo "REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')" >> $GITHUB_OUTPUT
31+ echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> $GITHUB_OUTPUT
3032 - name : Import this repository and generate XML artifacts
3133 run : |
3234 touch $PWD/app/port.xml
3335 chmod 777 $PWD/app/port.xml
34- docker pull ghcr.io/rfns/iris-ci/iris-ci:v0.6.2
3536 docker run --rm \
3637 -t --name xml-ci \
3738 -v $PWD/app:/opt/ci/app \
4445 - name : Retrieve the latest asset upload url
4546 id : release-asset-metadata
4647 run : |
47- upload_url=$(curl -s -X GET -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r '. | .upload_url')
48- echo ::set-output name= UPLOAD_URL::$ upload_url
48+ upload_url=$(curl -s -X GET -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/${{ steps.repository-metadata.outputs.VERSION }} | jq -r '. | .upload_url')
49+ echo " UPLOAD_URL=$(echo "$ upload_url")" >> $GITHUB_OUTPUT
4950 - name : Upload release asset
5051 id : release-asset-upload
5152 uses : actions/upload-release-asset@v1
5455 with :
5556 upload_url : ${{ steps.release-asset-metadata.outputs.UPLOAD_URL }}
5657 asset_path : app/port.xml
57- asset_name : port-${{ steps.parse-tag .outputs.VERSION }}.xml
58+ asset_name : port-${{ steps.repository-metadata .outputs.VERSION }}.xml
5859 asset_content_type : application/xml
0 commit comments