diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml new file mode 100644 index 0000000..12b68f2 --- /dev/null +++ b/.github/workflows/PR.yml @@ -0,0 +1,20 @@ +name: PR + +on: pull_request + +jobs: + build: + name: build + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: Select Xcode 11.3 + run: sudo xcode-select -s /Applications/Xcode_11.3.app + - name: Install dependencies + run: brew install ninja cmake lrzip + - name: Cloning Swift + run: ./clone.sh + - name: Building Swift + run: ./build.sh + - name: Packaging Swift + run: ./package.sh diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..90d884c --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,43 @@ +name: master + +on: + push: + branches: + - master + +jobs: + build: + name: Build and Publish + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: Select Xcode 11.3 + run: sudo xcode-select -s /Applications/Xcode_11.3.app + - name: Install Dependencies + run: brew install ninja cmake lrzip + - name: Clone Swift Repos + run: ./clone.sh + - name: Build Swift + run: ./build.sh + - name: Package Swift + run: ./package.sh + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./release/* + asset_name: my-artifact.zip + asset_content_type: application/zip diff --git a/SWIFT-VERSION b/SWIFT-VERSION index a6b3d05..8ed5184 100644 --- a/SWIFT-VERSION +++ b/SWIFT-VERSION @@ -1 +1 @@ -swift-5.0.1-RELEASE +swift-5.1.3-RELEASE diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 36fb770..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- master - -pr: - autoCancel: true - branches: - include: - - master - -jobs: -- job: macOS - timeoutInMinutes: 360 - displayName: macOS - # According to - # https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/macos/macos-10.14-Readme.md - # macOS-10.14 comes with Xcode 10.2.1 - pool: - displayName: 'macOS 10.14' - vmImage: 'macOS-10.14' - demands: xcode - steps: - - script: 'brew install ninja cmake lrzip' - displayName: 'Installing build dependencies' - - script: | - ./clone.sh - displayName: 'Cloning Swift' - - script: | - ./build.sh - displayName: 'Building Swift' - - script: | - ./package.sh - displayName: 'Packaging Swift' - - task: GitHubRelease@0 - displayName: 'Creating Github Release' - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/swift-') - inputs: - gitHubConnection: GHRelease - repositoryName: '$(Build.Repository.Name)' - action: 'create' # Options: create, edit, delete - target: '$(Build.SourceVersion)' # Required when action == Create || Action == Edit - tagSource: 'manual' # Required when action == Create# Options: auto, manual - tag: '$(Build.SourceVersion)-$(Build.BuildNumber)' - assets: 'release/*' - releaseNotesSource: 'file' # Optional. Options: file, input - releaseNotesFile: 'checksums.md' # Optional diff --git a/build.sh b/build.sh index f389334..e4821be 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -x + set -euo pipefail SWIFT_SOURCE=/tmp/swift-source diff --git a/clone.sh b/clone.sh index 9d515a1..c3aed90 100755 --- a/clone.sh +++ b/clone.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -x + set -euo pipefail SWIFT_VERSION=$(cat SWIFT-VERSION) @@ -8,4 +10,5 @@ SWIFT_SOURCE=/tmp/swift-source mkdir $SWIFT_SOURCE cd $SWIFT_SOURCE git clone https://github.com/apple/swift.git +(cd swift && git checkout "$SWIFT_VERSION") ./swift/utils/update-checkout --clone --tag "$SWIFT_VERSION" diff --git a/package.sh b/package.sh index ad414d8..225ca9f 100755 --- a/package.sh +++ b/package.sh @@ -11,7 +11,7 @@ BUILD_DIR=build/Ninja-RelWithDebInfoAssert RELEASE=release mkdir -p $RELEASE -case `uname -s` in +case $(uname -s) in Darwin) OS=macosx ;;