Skip to content

Commit 1eb278d

Browse files
authored
chore(actions): create xml asset
1 parent 800984d commit 1eb278d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Create XML release asset
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone this repository
13+
uses: actions/checkout@v2
14+
with:
15+
path: app
16+
- name: Clone IRIS-CI-XML
17+
uses: actions/checkout@v2
18+
with:
19+
path: iris-ci-xml
20+
repository: rfns/iris-ci-xml
21+
- name: Install dos2unix
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y dos2unix
25+
- name: Convert line endings to LF (Unix format)
26+
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\//}
30+
- name: Import this repository and generate XML artifacts
31+
run: |
32+
touch $PWD/app/port.xml
33+
chmod 777 $PWD/app/port.xml
34+
docker run --rm \
35+
-t --name xml-ci \
36+
-v $PWD/app:/opt/ci/app \
37+
-v $PWD/iris-ci-xml/ci/App/Installer.cls:/opt/ci/App/Installer.cls \
38+
-v $PWD/iris-ci-xml/ci/Runner.cls:/opt/ci/Runner.cls \
39+
-e PORT_CONFIGURATION_PROJECTNAME="port" \
40+
-e PORT_CONFIGURATION_LOGLEVEL=1 \
41+
-e CI_XML_FLAGS="/exportversion=2016.2" \
42+
rfns/iris-ci:0.6.1
43+
- name: Retrieve the latest asset upload url
44+
id: release-asset-metadata
45+
run: |
46+
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')
47+
echo ::set-output name=UPLOAD_URL::$upload_url
48+
- name: Upload release asset
49+
id: release-asset-upload
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
upload_url: ${{ steps.release-asset-metadata.outputs.UPLOAD_URL }}
55+
asset_path: app/port.xml
56+
asset_name: port-${{ steps.parse-tag.outputs.VERSION }}.xml
57+
asset_content_type: application/xml

0 commit comments

Comments
 (0)