Skip to content

Commit

Permalink
chore(actions): create xml asset
Browse files Browse the repository at this point in the history
  • Loading branch information
rfns authored Mar 1, 2021
1 parent 800984d commit 1eb278d
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/create-xml-asset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Create XML release asset

on:
release:
types: [published]

jobs:

build:
runs-on: ubuntu-latest
steps:
- name: Clone this repository
uses: actions/checkout@v2
with:
path: app
- name: Clone IRIS-CI-XML
uses: actions/checkout@v2
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 tag
id: parse-tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- 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="port" \
-e PORT_CONFIGURATION_LOGLEVEL=1 \
-e CI_XML_FLAGS="/exportversion=2016.2" \
rfns/iris-ci:0.6.1
- 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/latest | jq -r '. | .upload_url')
echo ::set-output name=UPLOAD_URL::$upload_url
- 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.parse-tag.outputs.VERSION }}.xml
asset_content_type: application/xml

0 comments on commit 1eb278d

Please sign in to comment.