-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
56 lines (50 loc) · 1.39 KB
/
action.yml
File metadata and controls
56 lines (50 loc) · 1.39 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
name: 'Basic Swift Action'
description: 'A basic GitHub Action template written in Swift'
author: 'Your Name'
branding:
icon: 'code'
color: 'orange'
inputs:
name:
description: 'Name to greet'
required: true
greeting:
description: 'Custom greeting message'
required: false
default: 'Hello'
verbose:
description: 'Enable verbose logging'
required: false
default: 'false'
outputs:
message:
description: 'The generated greeting message'
timestamp:
description: 'Timestamp of execution'
runs:
using: 'composite'
steps:
- name: Install Swift (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y wget
wget https://download.swift.org/swift-5.9-release/ubuntu2204/swift-5.9-RELEASE/swift-5.9-RELEASE-ubuntu22.04.tar.gz
tar xzf swift-5.9-RELEASE-ubuntu22.04.tar.gz
sudo mv swift-5.9-RELEASE-ubuntu22.04 /usr/share/swift
echo "/usr/share/swift/usr/bin" >> $GITHUB_PATH
shell: bash
- name: Build Action
run: |
cd ${{ github.action_path }}
swift build -c release
shell: bash
- name: Run Action
env:
INPUT_NAME: ${{ inputs.name }}
INPUT_GREETING: ${{ inputs.greeting }}
INPUT_VERBOSE: ${{ inputs.verbose }}
run: |
cd ${{ github.action_path }}
swift run -c release
shell: bash