Skip to content

Commit

Permalink
Merge pull request #54 from SwiftBuildTools/scott/46
Browse files Browse the repository at this point in the history
Scott/46
  • Loading branch information
ScottRobbins committed Nov 28, 2020
2 parents 36f355e + 7b7e9d5 commit 6749aad
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"createdAtDate" : "2020-11-28T18:49:49Z",
"tags" : [
"Added"
],
"description" : "Provide static binary with linux releases"
}
60 changes: 38 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,55 @@ jobs:
strategy:
matrix:
image:
# 5.3 Stable
- swift:5.3-xenial
- swift:5.3-bionic
- swift:5.3-focal
- swift:5.3-centos8
- swift:5.3-amazonlinux2
# 5.3.1 Stable
- swift:5.3.1-xenial
- swift:5.3.1-bionic
- swift:5.3.1-focal
- swift:5.3.1-centos8
- swift:5.3.1-amazonlinux2
include:
- image: swift:5.3-xenial
IMAGE_IDENTIFIER: swift-5-3-xenial
- image: swift:5.3-bionic
IMAGE_IDENTIFIER: swift-5-3-bionic
- image: swift:5.3-focal
IMAGE_IDENTIFIER: swift-5-3-focal
- image: swift:5.3-centos8
IMAGE_IDENTIFIER: swift-5-3-centos8
- image: swift:5.3-amazonlinux2
IMAGE_IDENTIFIER: swift-5-3-amazonlinux2
- image: swift:5.3.1-xenial
IMAGE_IDENTIFIER: swift-5-3-1-xenial
- image: swift:5.3.1-bionic
IMAGE_IDENTIFIER: swift-5-3-1-bionic
- image: swift:5.3.1-focal
IMAGE_IDENTIFIER: swift-5-3-1-focal
- image: swift:5.3.1-centos8
IMAGE_IDENTIFIER: swift-5-3-1-centos8
- image: swift:5.3.1-amazonlinux2
IMAGE_IDENTIFIER: swift-5-3-1-amazonlinux2
container: ${{ matrix.image }}
steps:
- uses: actions/checkout@v2
- name: Build
- name: Build Dynamic
run: swift build -c release
- name: Package
- name: Package Dynamic
run: tar -C .build/release -cvzf changes.tar.gz changes
- name: Upload Build Asset
id: upload-release-asset
- name: Upload Dynamic Build Asset
id: upload-dynamic-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: changes.tar.gz
asset_name: changes-${{ matrix.IMAGE_IDENTIFIER }}-dynamic.tar.gz
asset_content_type: application/gzip
- name: Clear cache
run: rm -rf .build
- name: Build Static
run: swift build -c release -Xswiftc -static-executable
- name: Package Static
run: tar -C .build/release -cvzf changes.tar.gz changes
- name: Upload Static Build Asset
id: upload-static-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: changes.tar.gz
asset_name: changes-${{ matrix.IMAGE_IDENTIFIER }}.tar.gz
asset_name: changes-${{ matrix.IMAGE_IDENTIFIER }}-static.tar.gz
asset_content_type: application/gzip
macOS:
runs-on: macos-latest
Expand All @@ -82,7 +98,7 @@ jobs:
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: changes.tar.gz
asset_name: changes-swift-5-3-macOS.tar.gz
asset_name: changes-swift-5-3-macOS-dynamic.tar.gz
asset_content_type: application/gzip


Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3.0
5.3.1
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This file is auto-generated by Changes. Any modifications made to it will be ove
- Added ability to regenerate specific files from config
- Added ability to query for releases
- Ability to query for changes entries
- Provide static binary with linux releases

### Changed
- Made the unpackaged binary name consistently referenced in the README
Expand Down
2 changes: 1 addition & 1 deletion Sources/ChangesCLI/Commands/Add.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct Add: ParsableCommand {
}
}
else {
outputFolder = try workingFolder.subfolder(named: ".changes/unreleased/entries")
outputFolder = try workingFolder.createSubfolderIfNeeded(at: ".changes/unreleased/entries")
}

let date = Date()
Expand Down
12 changes: 8 additions & 4 deletions Sources/ChangesCLI/Commands/Releases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,22 @@ struct Releases: ParsableCommand {
versions: explicitVersions,
includeLatest: includeLatest
)
} else if let start = start, let end = end {
}
else if let start = start, let end = end {
let startVersion = try Version(start)
let endVersion = try Version(end)

queriedReleases = try releaseQuerier.query(versions: startVersion...endVersion)
} else if let start = start {
}
else if let start = start {
let startVersion = try Version(start)
queriedReleases = try releaseQuerier.query(versions: startVersion...)
} else if let end = end {
}
else if let end = end {
let endVersion = try Version(end)
queriedReleases = try releaseQuerier.query(versions: ...endVersion)
} else {
}
else {
queriedReleases = try releaseQuerier.queryAll()
}

Expand Down

0 comments on commit 6749aad

Please sign in to comment.