v1.2.3 #7
Workflow file for this run
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
name: Create XML release asset | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone this repository | |
uses: actions/checkout@v4 | |
with: | |
path: app | |
- name: Clone IRIS-CI-XML | |
uses: actions/checkout@v4 | |
with: | |
path: iris-ci-xml | |
repository: rfns/iris-ci-xml | |
- name: Install dos2unix | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y dos2unix | |
- name: Convert line endings to LF (Unix format) | |
run: find . -type f -exec dos2unix {} \; | |
- name: Parse the repository metadata | |
id: repository-metadata | |
run: | | |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
echo "REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')" >> $GITHUB_OUTPUT | |
echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> $GITHUB_OUTPUT | |
- name: Import this repository and generate XML artifacts | |
run: | | |
touch $PWD/app/port.xml | |
chmod 777 $PWD/app/port.xml | |
docker run --rm \ | |
-t --name xml-ci \ | |
-v $PWD/app:/opt/ci/app \ | |
-v $PWD/iris-ci-xml/ci/App/Installer.cls:/opt/ci/App/Installer.cls \ | |
-v $PWD/iris-ci-xml/ci/Runner.cls:/opt/ci/Runner.cls \ | |
-e PORT_CONFIGURATION_PROJECTNAME="${{ steps.repository-metadata.outputs.REPOSITORY_NAME }}" \ | |
-e PORT_CONFIGURATION_LOGLEVEL=1 \ | |
-e CI_XML_FLAGS="/exportversion=2016.2" \ | |
ghcr.io/rfns/iris-ci/iris-ci:v0.6.3 | |
- name: Retrieve the latest asset upload url | |
id: release-asset-metadata | |
run: | | |
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') | |
echo "UPLOAD_URL=$(echo "$upload_url")" >> $GITHUB_OUTPUT | |
- name: Upload release asset | |
id: release-asset-upload | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release-asset-metadata.outputs.UPLOAD_URL }} | |
asset_path: app/port.xml | |
asset_name: port-${{ steps.repository-metadata.outputs.VERSION }}.xml | |
asset_content_type: application/xml |