Skip to content

Commit

Permalink
Add post-merge CI and build release workflows (#185)
Browse files Browse the repository at this point in the history
After squashing and mergin a commit on top of what's on the main
branch there can be merge issues. Add a post-merge (ie. push)
trigger for the same workflows that are used for pull requests to
help flag merge issues.

For these workflows, it will be useful to upload the release
artifacts in case someone would like to manually test it. In the
future there is also a possibility of larger e2e test suites that
could run on fresh Linux containers without existing swift toolchains.

Add a new workflow to produce release artifacts for Linux on a
manual workflow dispatch either from the GitHub UI, or via the REST
interface.
  • Loading branch information
cmcgee1024 authored Nov 13, 2024
1 parent 9748352 commit 5d8ac14
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 11 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Release

on:
workflow_dispatch:
inputs:
version:
description: "Version of swiftly to build release artifacts"
required: true
type: string
default: "0.3.0"
skip:
description: "Perform release checks, such as the git tag, and swift version, or '--skip' to skip that."
required: true
type: string
default: "--skip"

jobs:
buildrelease:
name: Build Release
runs-on: ubuntu-latest
container:
image: "swift:6.0-rhel-ubi9"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Artifact
run: swift run build-swiftly-release ${{ inputs.skip }} ${{ inputs.version }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
path: .build/release/swiftly-*.tar.gz
if-no-files-found: error
30 changes: 19 additions & 11 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Pull request
name: Pull Request

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches: [main]

jobs:
soundness:
Expand All @@ -28,16 +30,22 @@ jobs:
linux_pre_build_command: ./scripts/prep-gh-action.sh && ./scripts/install-libarchive.sh
enable_windows_checks: false

releasebuild:
name: Release Build
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_os_versions: "[\"rhel-ubi9\"]"
# We only care about the current stable release, because that's where we make our swiftly releases
linux_exclude_swift_versions: "[{\"swift_version\": \"nightly-main\"},{\"swift_version\": \"nightly-6.0\"},{\"swift_version\": \"5.8\"},{\"swift_version\": \"5.9\"},{\"swift_version\": \"5.10\"}]"
linux_pre_build_command: ./scripts/prep-gh-action.sh
linux_build_command: swift run build-swiftly-release --skip 0.4.0
enable_windows_checks: false
releasebuildcheck:
name: Release Build Check
runs-on: ubuntu-latest
container:
image: "swift:6.0-rhel-ubi9"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Artifact
run: swift run build-swiftly-release --skip "999.0.0"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
path: .build/release/swiftly-*.tar.gz
if-no-files-found: error
retention-days: 1

formatcheck:
name: Format Check
Expand Down

0 comments on commit 5d8ac14

Please sign in to comment.