-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
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 |