diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index ae3d6295f..e53e0e997 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -17,34 +17,16 @@ jobs: linux_build: runs-on: ubuntu-latest steps: - # - name: Setup Swift - # # You may pin to the exact commit or the version. - # # uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf - # uses: swift-actions/setup-swift@v1.23.0 - # with: - # # Swift version to configure - # swift-version: 5.9 # default is 5.8 - - name: Setup Swift environment for macOS, Linux and Windows - uses: SwiftyLab/setup-swift@v1.4.1 + - name: Setup Swift + uses: swift-actions/setup-swift@v1.26.0 with: - swift-version: "5.9" + swift-version: "5.9.2" - name: Get swift version run: swift --version - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 - with: - ruby-version: '3.1' - name: Install dependencies run: | - sudo apt install libffi-dev sudo apt install build-essential - sudo apt install libsqlite3-dev - sudo apt-get install libncurses5-dev shell: bash - - name: Bundle Install - run: bundle install - - name: Swift Build - run: swift build - name: Run tests run: swift test diff --git a/.github/workflows/bump_homebrew.yml b/.github/workflows/bump_homebrew.yml new file mode 100644 index 000000000..405a6acd3 --- /dev/null +++ b/.github/workflows/bump_homebrew.yml @@ -0,0 +1,18 @@ +on: + workflow_dispatch: + inputs: + tag-name: + description: 'The git tag name to bump the formula to' + required: true + +jobs: + homebrew: + name: Bump Homebrew formula + runs-on: macos-13 + steps: + - uses: mislav/bump-homebrew-formula-action@v3 + with: + formula-name: sourcery + tag-name: ${{ github.event.inputs.tag-name }} + env: + COMMITTER_TOKEN: ${{ secrets.HOMEBREW_COMMITTER_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release_Ubuntu.yml b/.github/workflows/release_Ubuntu.yml new file mode 100644 index 000000000..f41e89659 --- /dev/null +++ b/.github/workflows/release_Ubuntu.yml @@ -0,0 +1,29 @@ +name: Build for Linux + +on: + workflow_dispatch: + inputs: + ref: + description: 'Ref to build (branch, tag or SHA)' + required: false + default: 'main' + +jobs: + build: + name: Build SwiftFormat for Linux + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.ref }} + - name: Build it + run: | + swift build --configuration release --static-swift-stdlib --enable-dead-strip + SWIFTFORMAT_BIN_PATH=`swift build --configuration release --show-bin-path` + mv $SWIFTFORMAT_BIN_PATH/swiftformat "${HOME}/swiftformat_linux" + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: swiftformat_linux + path: ~/swiftformat_linux + retention-days: 5 diff --git a/.github/workflows/release_macOS.yml b/.github/workflows/release_macOS.yml new file mode 100644 index 000000000..f41e89659 --- /dev/null +++ b/.github/workflows/release_macOS.yml @@ -0,0 +1,29 @@ +name: Build for Linux + +on: + workflow_dispatch: + inputs: + ref: + description: 'Ref to build (branch, tag or SHA)' + required: false + default: 'main' + +jobs: + build: + name: Build SwiftFormat for Linux + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.ref }} + - name: Build it + run: | + swift build --configuration release --static-swift-stdlib --enable-dead-strip + SWIFTFORMAT_BIN_PATH=`swift build --configuration release --show-bin-path` + mv $SWIFTFORMAT_BIN_PATH/swiftformat "${HOME}/swiftformat_linux" + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: swiftformat_linux + path: ~/swiftformat_linux + retention-days: 5