-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
44 lines (41 loc) · 1.29 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright (c) 2022 Jaehong Kang
# Licensed under Apache License v2.0
name: 'GitHub Actions for Swift'
description: 'Additional Swift supports on GitHub Actions'
author: 'Jaehong Kang <[email protected]>'
branding:
icon: 'code'
color: 'orange'
inputs:
swift-image-tag:
description: 'A Swift docker image tag to use.'
required: false
swift-version:
description: 'A Swift version to download using swift-env.'
required: false
args:
description: 'Arguments to Swift.'
required: true
runs:
using: 'composite'
steps:
- if: ${{ inputs.swift-version != null }}
uses: sinoru/actions-setup-swift@v2
with:
swift-version: ${{ inputs.swift-version }}
- if: ${{ inputs.swift-image-tag != null }}
shell: bash
run: docker pull swift:${{ inputs.swift-image-tag }}
- if: ${{ inputs.swift-image-tag == null }}
shell: bash
run: '"${{ github.action_path }}/swift" ${{ inputs.args }}'
- if: ${{ inputs.swift-image-tag != null }}
shell: bash
run: |
docker run \
-a stdin -a stdout -a stderr \
-v "${{ github.action_path }}":/opt/actions-swift \
-v `pwd`:`pwd` -w `pwd` \
--entrypoint "/opt/actions-swift/swift" \
swift:${{ inputs.swift-image-tag }} \
${{ inputs.args }}