Skip to content

Commit

Permalink
new GH actions for release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
art-divin committed Jan 13, 2024
1 parent 5856e3b commit e5f5996
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 21 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
# with:
# # Swift version to configure
# swift-version: 5.9 # default is 5.8
- name: Setup Swift environment for macOS, Linux and Windows
uses: SwiftyLab/[email protected]
- name: Setup Swift
uses: swift-actions/[email protected]
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
18 changes: 18 additions & 0 deletions .github/workflows/bump_homebrew.yml
Original file line number Diff line number Diff line change
@@ -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 }}
29 changes: 29 additions & 0 deletions .github/workflows/release_Ubuntu.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions .github/workflows/release_macOS.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e5f5996

Please sign in to comment.