-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f6b7592
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// swift-tools-version: 5.10 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
import PackageDescription | ||
|
||
let version = "0.0.2" | ||
let moduleName = "Citiwastelib" | ||
let checksum = "" | ||
|
||
let package = Package( | ||
name: moduleName, | ||
products: [ | ||
.library( | ||
name: moduleName, | ||
targets: [moduleName] | ||
) | ||
], | ||
targets: [ | ||
.binaryTarget( | ||
name: moduleName, | ||
url: "https://github.com/albetoetecnia/CitiwastelibsDistribution/releases/download/\(version)/\(moduleName).xcframework.zip", | ||
checksum: checksum | ||
) | ||
] | ||
) |
2 changes: 2 additions & 0 deletions
2
Sources/CitiwastelibsDistribution/CitiwastelibsDistribution.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// The Swift Programming Language | ||
// https://docs.swift.org/swift-book |
12 changes: 12 additions & 0 deletions
12
Tests/CitiwastelibsDistributionTests/CitiwastelibsDistributionTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import XCTest | ||
@testable import CitiwastelibsDistribution | ||
|
||
final class CitiwastelibsDistributionTests: XCTestCase { | ||
func testExample() throws { | ||
// XCTest Documentation | ||
// https://developer.apple.com/documentation/xctest | ||
|
||
// Defining Test Cases and Test Methods | ||
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
|
||
# prepare_package.sh | ||
# Citiwastelib | ||
# | ||
# Created by Alberto Bailac Moreno on 1/7/24. | ||
# | ||
|
||
# Check for arguments | ||
if [ $# -eq 0 ]; then | ||
echo "No arguments provided. First argument has to be version, e.g. '1.8.1'" | ||
exit 1 | ||
fi | ||
|
||
# 1. Get params | ||
NEW_VERSION=$1 | ||
FRAMEWORK_NAME=$2 | ||
|
||
# 2. Calculate checksum and store it | ||
echo "calculate new checksum" | ||
NEW_CHECKSUM=$(swift package compute-checksum $FRAMEWORK_NAME.xcframework.zip) | ||
echo "print out new shasum for convenience reasons" | ||
echo "New checksum is $NEW_CHECKSUM" | ||
|
||
# 3. Replace all data from Package.swift manifest | ||
echo "replace name module information in package manifest" | ||
sed -E -i '' 's/let moduleName = ".+"/let moduleName = "'$FRAMEWORK_NAME\"/ Package.swift | ||
echo "replace version information in package manifest" | ||
sed -E -i '' 's/let version = ".+"/let version = "'$NEW_VERSION\"/ Package.swift | ||
echo "replace checksum information in package manifest" | ||
sed -E -i '' 's/let checksum = ".+"/let checksum = "'$NEW_CHECKSUM\"/ Package.swift | ||
|
||
# 4. Print new content of manifest | ||
echo "print out package manifest for convenience reasons" | ||
cat Package.swift | ||
|
||
# 5. Commit all data without the XCfrmework | ||
echo "git commit all without framework and push" | ||
git add --all -- :!$FRAMEWORK_NAME.xcframework.zip | ||
git commit -m "New $FRAMEWORK_NAME version $NEW_VERSION" | ||
git push | ||
|
||
# 6. Pusblish a new release with the same version of the repository A, and attach XCFramework in the Release metadata | ||
echo "Releasing the new version" | ||
gh release create "$NEW_VERSION" --generate-notes "./CitiwastelibDistribution/$FRAMEWORK_NAME.xcframework.zip" | ||
|
||
# 7. Remove zip of XCFramework | ||
#echo "delete downloaded zip file" | ||
#rm "./CitiwastelibDistribution/$FRAMEWORK_NAME.xcframework.zip" |