├── .dockerignore ├── .github └── workflows │ └── main.yml ├── action.yml ├── README.md ├── Dockerfile ├── LICENSE └── .gitignore /.dockerignore: -------------------------------------------------------------------------------- 1 | # Swift Package Manager 2 | .build 3 | 4 | # Xcode User Data 5 | *.xcodeproj/* 6 | !*.xcodeproj/project.pbxproj 7 | !*.xcodeproj/xcshareddata/ 8 | !*.xcworkspace/contents.xcworkspacedata 9 | /*.gcno 10 | **/xcshareddata/WorkspaceSettings.xcsettings 11 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: [push] 2 | 3 | jobs: 4 | 5 | build: 6 | 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v1 11 | name: Checkout Repository 12 | - uses: ./ 13 | name: Run Swift Action 14 | with: 15 | swift-action: '--version' 16 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Swift Action' 2 | description: 'Provides Swift support for GitHub Actions.' 3 | author: 'Didstopia' 4 | branding: 5 | icon: 'code' 6 | color: 'orange' 7 | inputs: 8 | swift-action: 9 | description: 'Swift action to run' 10 | required: true 11 | default: 'build' 12 | runs: 13 | using: 'docker' 14 | image: 'Dockerfile' 15 | args: 16 | - ${{ inputs.swift-action }} 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Swift Action 2 | 3 | Provides [Swift](https://swift.org) support for [GitHub Actions](https://github.com/features/actions). 4 | 5 | ## Usage 6 | 7 | ``` 8 | uses: Didstopia/SwiftAction@v1.0.1 9 | with: 10 | swift-action: 'build' 11 | ``` 12 | 13 | To use the latest development version of this action, change the version number to `master` (eg. `Didstopia/SwiftAction@master`). 14 | 15 | ## Inputs 16 | 17 | #### `swift-action` 18 | 19 | **Required** Swift action to run. Default `"build"`. 20 | 21 | ## License 22 | 23 | [MIT](LICENSE) 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Set the base image to the target Swift version 2 | FROM swift:5.3 3 | 4 | # Add labels the Docker image 5 | LABEL "repository"="https://github.com/Didstopia/SwiftAction" 6 | LABEL "homepage"="https://swift.org" 7 | LABEL "maintainer"="Didstopia " 8 | 9 | # Add labels for GitHub Actions 10 | LABEL "com.github.actions.name"="Swift Action" 11 | LABEL "com.github.actions.description"="Provides Swift support for GitHub Actions." 12 | LABEL "com.github.actions.icon"="code" 13 | LABEL "com.github.actions.color"="orange" 14 | 15 | # Create the entrypoint script 16 | RUN echo "#!/bin/sh\n\ 17 | set -eux\n\ 18 | sh -c \"swift \$*\""\ 19 | > /entrypoint.sh && \ 20 | chmod +x /entrypoint.sh 21 | 22 | # Set the default entrypoint with support for arguments 23 | ENTRYPOINT ["/entrypoint.sh"] 24 | 25 | # Set the default command to run 26 | CMD ["--help"] 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Didstopia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/linux,xcode,macos,windows,visualstudio,visualstudiocode 3 | # Edit at https://www.gitignore.io/?templates=linux,xcode,macos,windows,visualstudio,visualstudiocode 4 | 5 | ### Linux ### 6 | *~ 7 | 8 | # temporary files which can be created if a process still has a handle open of a deleted file 9 | .fuse_hidden* 10 | 11 | # KDE directory preferences 12 | .directory 13 | 14 | # Linux trash folder which might appear on any partition or disk 15 | .Trash-* 16 | 17 | # .nfs files are created when an open file is removed but is still being accessed 18 | .nfs* 19 | 20 | ### macOS ### 21 | # General 22 | .DS_Store 23 | .AppleDouble 24 | .LSOverride 25 | 26 | # Swift builds 27 | .build 28 | 29 | # Icon must end with two \r 30 | Icon 31 | 32 | # Thumbnails 33 | ._* 34 | 35 | # Files that might appear in the root of a volume 36 | .DocumentRevisions-V100 37 | .fseventsd 38 | .Spotlight-V100 39 | .TemporaryItems 40 | .Trashes 41 | .VolumeIcon.icns 42 | .com.apple.timemachine.donotpresent 43 | 44 | # Directories potentially created on remote AFP share 45 | .AppleDB 46 | .AppleDesktop 47 | Network Trash Folder 48 | Temporary Items 49 | .apdisk 50 | 51 | ### VisualStudioCode ### 52 | .vscode/* 53 | !.vscode/settings.json 54 | !.vscode/tasks.json 55 | !.vscode/launch.json 56 | !.vscode/extensions.json 57 | 58 | ### VisualStudioCode Patch ### 59 | # Ignore all local history of files 60 | .history 61 | 62 | ### Windows ### 63 | # Windows thumbnail cache files 64 | Thumbs.db 65 | ehthumbs.db 66 | ehthumbs_vista.db 67 | 68 | # Dump file 69 | *.stackdump 70 | 71 | # Folder config file 72 | [Dd]esktop.ini 73 | 74 | # Recycle Bin used on file shares 75 | $RECYCLE.BIN/ 76 | 77 | # Windows Installer files 78 | *.cab 79 | *.msi 80 | *.msix 81 | *.msm 82 | *.msp 83 | 84 | # Windows shortcuts 85 | *.lnk 86 | 87 | ### Xcode ### 88 | # Xcode 89 | # 90 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 91 | 92 | ## User settings 93 | xcuserdata/ 94 | 95 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 96 | *.xcscmblueprint 97 | *.xccheckout 98 | 99 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 100 | build/ 101 | DerivedData/ 102 | *.moved-aside 103 | *.pbxuser 104 | !default.pbxuser 105 | *.mode1v3 106 | !default.mode1v3 107 | *.mode2v3 108 | !default.mode2v3 109 | *.perspectivev3 110 | !default.perspectivev3 111 | 112 | ### Xcode Patch ### 113 | *.xcodeproj/* 114 | !*.xcodeproj/project.pbxproj 115 | !*.xcodeproj/xcshareddata/ 116 | !*.xcworkspace/contents.xcworkspacedata 117 | /*.gcno 118 | **/xcshareddata/WorkspaceSettings.xcsettings 119 | 120 | ### VisualStudio ### 121 | ## Ignore Visual Studio temporary files, build results, and 122 | ## files generated by popular Visual Studio add-ons. 123 | ## 124 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 125 | 126 | # User-specific files 127 | *.rsuser 128 | *.suo 129 | *.user 130 | *.userosscache 131 | *.sln.docstates 132 | 133 | # User-specific files (MonoDevelop/Xamarin Studio) 134 | *.userprefs 135 | 136 | # Mono auto generated files 137 | mono_crash.* 138 | 139 | # Build results 140 | [Dd]ebug/ 141 | [Dd]ebugPublic/ 142 | [Rr]elease/ 143 | [Rr]eleases/ 144 | x64/ 145 | x86/ 146 | [Aa][Rr][Mm]/ 147 | [Aa][Rr][Mm]64/ 148 | bld/ 149 | [Bb]in/ 150 | [Oo]bj/ 151 | [Ll]og/ 152 | 153 | # Visual Studio 2015/2017 cache/options directory 154 | .vs/ 155 | # Uncomment if you have tasks that create the project's static files in wwwroot 156 | #wwwroot/ 157 | 158 | # Visual Studio 2017 auto generated files 159 | Generated\ Files/ 160 | 161 | # MSTest test Results 162 | [Tt]est[Rr]esult*/ 163 | [Bb]uild[Ll]og.* 164 | 165 | # NUNIT 166 | *.VisualState.xml 167 | TestResult.xml 168 | 169 | # Build Results of an ATL Project 170 | [Dd]ebugPS/ 171 | [Rr]eleasePS/ 172 | dlldata.c 173 | 174 | # Benchmark Results 175 | BenchmarkDotNet.Artifacts/ 176 | 177 | # .NET Core 178 | project.lock.json 179 | project.fragment.lock.json 180 | artifacts/ 181 | 182 | # StyleCop 183 | StyleCopReport.xml 184 | 185 | # Files built by Visual Studio 186 | *_i.c 187 | *_p.c 188 | *_h.h 189 | *.ilk 190 | *.meta 191 | *.obj 192 | *.iobj 193 | *.pch 194 | *.pdb 195 | *.ipdb 196 | *.pgc 197 | *.pgd 198 | *.rsp 199 | *.sbr 200 | *.tlb 201 | *.tli 202 | *.tlh 203 | *.tmp 204 | *.tmp_proj 205 | *_wpftmp.csproj 206 | *.log 207 | *.vspscc 208 | *.vssscc 209 | .builds 210 | *.pidb 211 | *.svclog 212 | *.scc 213 | 214 | # Chutzpah Test files 215 | _Chutzpah* 216 | 217 | # Visual C++ cache files 218 | ipch/ 219 | *.aps 220 | *.ncb 221 | *.opendb 222 | *.opensdf 223 | *.sdf 224 | *.cachefile 225 | *.VC.db 226 | *.VC.VC.opendb 227 | 228 | # Visual Studio profiler 229 | *.psess 230 | *.vsp 231 | *.vspx 232 | *.sap 233 | 234 | # Visual Studio Trace Files 235 | *.e2e 236 | 237 | # TFS 2012 Local Workspace 238 | $tf/ 239 | 240 | # Guidance Automation Toolkit 241 | *.gpState 242 | 243 | # ReSharper is a .NET coding add-in 244 | _ReSharper*/ 245 | *.[Rr]e[Ss]harper 246 | *.DotSettings.user 247 | 248 | # JustCode is a .NET coding add-in 249 | .JustCode 250 | 251 | # TeamCity is a build add-in 252 | _TeamCity* 253 | 254 | # DotCover is a Code Coverage Tool 255 | *.dotCover 256 | 257 | # AxoCover is a Code Coverage Tool 258 | .axoCover/* 259 | !.axoCover/settings.json 260 | 261 | # Visual Studio code coverage results 262 | *.coverage 263 | *.coveragexml 264 | 265 | # NCrunch 266 | _NCrunch_* 267 | .*crunch*.local.xml 268 | nCrunchTemp_* 269 | 270 | # MightyMoose 271 | *.mm.* 272 | AutoTest.Net/ 273 | 274 | # Web workbench (sass) 275 | .sass-cache/ 276 | 277 | # Installshield output folder 278 | [Ee]xpress/ 279 | 280 | # DocProject is a documentation generator add-in 281 | DocProject/buildhelp/ 282 | DocProject/Help/*.HxT 283 | DocProject/Help/*.HxC 284 | DocProject/Help/*.hhc 285 | DocProject/Help/*.hhk 286 | DocProject/Help/*.hhp 287 | DocProject/Help/Html2 288 | DocProject/Help/html 289 | 290 | # Click-Once directory 291 | publish/ 292 | 293 | # Publish Web Output 294 | *.[Pp]ublish.xml 295 | *.azurePubxml 296 | # Note: Comment the next line if you want to checkin your web deploy settings, 297 | # but database connection strings (with potential passwords) will be unencrypted 298 | *.pubxml 299 | *.publishproj 300 | 301 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 302 | # checkin your Azure Web App publish settings, but sensitive information contained 303 | # in these scripts will be unencrypted 304 | PublishScripts/ 305 | 306 | # NuGet Packages 307 | *.nupkg 308 | # The packages folder can be ignored because of Package Restore 309 | **/[Pp]ackages/* 310 | # except build/, which is used as an MSBuild target. 311 | !**/[Pp]ackages/build/ 312 | # Uncomment if necessary however generally it will be regenerated when needed 313 | #!**/[Pp]ackages/repositories.config 314 | # NuGet v3's project.json files produces more ignorable files 315 | *.nuget.props 316 | *.nuget.targets 317 | 318 | # Microsoft Azure Build Output 319 | csx/ 320 | *.build.csdef 321 | 322 | # Microsoft Azure Emulator 323 | ecf/ 324 | rcf/ 325 | 326 | # Windows Store app package directories and files 327 | AppPackages/ 328 | BundleArtifacts/ 329 | Package.StoreAssociation.xml 330 | _pkginfo.txt 331 | *.appx 332 | *.appxbundle 333 | *.appxupload 334 | 335 | # Visual Studio cache files 336 | # files ending in .cache can be ignored 337 | *.[Cc]ache 338 | # but keep track of directories ending in .cache 339 | !?*.[Cc]ache/ 340 | 341 | # Others 342 | ClientBin/ 343 | ~$* 344 | *.dbmdl 345 | *.dbproj.schemaview 346 | *.jfm 347 | *.pfx 348 | *.publishsettings 349 | orleans.codegen.cs 350 | 351 | # Including strong name files can present a security risk 352 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 353 | #*.snk 354 | 355 | # Since there are multiple workflows, uncomment next line to ignore bower_components 356 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 357 | #bower_components/ 358 | 359 | # RIA/Silverlight projects 360 | Generated_Code/ 361 | 362 | # Backup & report files from converting an old project file 363 | # to a newer Visual Studio version. Backup files are not needed, 364 | # because we have git ;-) 365 | _UpgradeReport_Files/ 366 | Backup*/ 367 | UpgradeLog*.XML 368 | UpgradeLog*.htm 369 | ServiceFabricBackup/ 370 | *.rptproj.bak 371 | 372 | # SQL Server files 373 | *.mdf 374 | *.ldf 375 | *.ndf 376 | 377 | # Business Intelligence projects 378 | *.rdl.data 379 | *.bim.layout 380 | *.bim_*.settings 381 | *.rptproj.rsuser 382 | *- Backup*.rdl 383 | 384 | # Microsoft Fakes 385 | FakesAssemblies/ 386 | 387 | # GhostDoc plugin setting file 388 | *.GhostDoc.xml 389 | 390 | # Node.js Tools for Visual Studio 391 | .ntvs_analysis.dat 392 | node_modules/ 393 | 394 | # Visual Studio 6 build log 395 | *.plg 396 | 397 | # Visual Studio 6 workspace options file 398 | *.opt 399 | 400 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 401 | *.vbw 402 | 403 | # Visual Studio LightSwitch build output 404 | **/*.HTMLClient/GeneratedArtifacts 405 | **/*.DesktopClient/GeneratedArtifacts 406 | **/*.DesktopClient/ModelManifest.xml 407 | **/*.Server/GeneratedArtifacts 408 | **/*.Server/ModelManifest.xml 409 | _Pvt_Extensions 410 | 411 | # Paket dependency manager 412 | .paket/paket.exe 413 | paket-files/ 414 | 415 | # FAKE - F# Make 416 | .fake/ 417 | 418 | # CodeRush personal settings 419 | .cr/personal 420 | 421 | # Python Tools for Visual Studio (PTVS) 422 | __pycache__/ 423 | *.pyc 424 | 425 | # Cake - Uncomment if you are using it 426 | # tools/** 427 | # !tools/packages.config 428 | 429 | # Tabs Studio 430 | *.tss 431 | 432 | # Telerik's JustMock configuration file 433 | *.jmconfig 434 | 435 | # BizTalk build output 436 | *.btp.cs 437 | *.btm.cs 438 | *.odx.cs 439 | *.xsd.cs 440 | 441 | # OpenCover UI analysis results 442 | OpenCover/ 443 | 444 | # Azure Stream Analytics local run output 445 | ASALocalRun/ 446 | 447 | # MSBuild Binary and Structured Log 448 | *.binlog 449 | 450 | # NVidia Nsight GPU debugger configuration file 451 | *.nvuser 452 | 453 | # MFractors (Xamarin productivity tool) working folder 454 | .mfractor/ 455 | 456 | # Local History for Visual Studio 457 | .localhistory/ 458 | 459 | # BeatPulse healthcheck temp database 460 | healthchecksdb 461 | 462 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 463 | MigrationBackup/ 464 | 465 | # End of https://www.gitignore.io/api/linux,xcode,macos,windows,visualstudio,visualstudiocode 466 | --------------------------------------------------------------------------------