Skip to content

Commit

Permalink
Merge pull request #4 from giginet/support-artifactbundle-action
Browse files Browse the repository at this point in the history
Support Artifact Bundle
  • Loading branch information
giginet authored Jun 30, 2024
2 parents abf1183 + 9edb4ba commit b37aa9c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
release:
types: [created]

name: Upload Artifact Bundle to Release
env:
DEVELOPER_DIR: "/Applications/Xcode_15.3.app/Contents/Developer"
SWIFT_TESTING_REVOLUTIONARY_DEVELOPMENT: 1

jobs:
release:
name: Build and Upload Artifact Bundle
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- name: Resolve Dependencies
run: |
swift package resolve
- name: Build Binary
run: |
swift build --disable-sandbox -c release --arch arm64 --arch x86_64 --target swift-testing-revolutionary
- name: Get Current Tag
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Make Artifact Bundle
run: |
swift package --allow-writing-to-package-directory generate-artifact-bundle \
--package-version ${{ env.TAG_NAME }} \
--executable-name swift-testing-revolutionary \
--build-config release \
--build-folder .build
- name: Upload Artifact Bundle to Release
run: |
gh release upload ${{ env.TAG_NAME }} ./swift-testing-revolutionary.artifactbundle.zip
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
.swiftpm
*.artifactbundle.zip
9 changes: 9 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
import Foundation

let package = Package(
name: "swift-testing-revolutionary",
Expand Down Expand Up @@ -76,3 +77,11 @@ let package = Package(
],
swiftLanguageVersions: [.v6]
)

let isDevelopment = ProcessInfo.processInfo.environment["SWIFT_TESTING_REVOLUTIONARY_DEVELOPMENT"] == "1"

if isDevelopment {
package.dependencies += [
.package(url: "https://github.com/freddi-kit/ArtifactBundleGen.git", from: "0.0.6"),
]
}

0 comments on commit b37aa9c

Please sign in to comment.