Skip to content

Commit 37e2639

Browse files
committed
add ci workflows
1 parent 5a84a42 commit 37e2639

3 files changed

Lines changed: 61 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build-codeedit-cli:
11+
name: Building CodeEdit CLI
12+
runs-on: macos-12
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v2
16+
17+
- name: Building
18+
run: swift build -c release

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
push:
6+
tags:
7+
- '*.*.*'
8+
9+
jobs:
10+
deploy-codeedit-cli:
11+
name: Deploying CodeEdit CLI
12+
runs-on: macos-12
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v2
16+
17+
- name: Building
18+
run: |
19+
swift build -c release
20+
cd .build/release
21+
zip codeedit-cli.zip codeedit-cli
22+
cd ../..
23+
24+
- name: Create Release
25+
id: create_release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: ${{ github.ref }}
31+
release_name: ${{ github.ref }}
32+
draft: false
33+
prerelease: false
34+
35+
- name: Upload Release Asset
36+
uses: actions/upload-release-asset@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
upload_url: ${{ steps.create_release.outputs.upload_url }}
41+
asset_path: .build/release/codeedit-cli.zip
42+
asset_name: codeedit-cli-${{ github.ref }}.zip
43+
asset_content_type: application/zip

Package.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ let package = Package(
1212
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0")
1313
],
1414
targets: [
15-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
16-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
1715
.executableTarget(
1816
name: "CodeEditCLI",
1917
dependencies: [

0 commit comments

Comments
 (0)