From 68df604588ed69b785ab4d6ac552054b611ce6de Mon Sep 17 00:00:00 2001 From: "Chris (SPG) McGee" Date: Fri, 8 Nov 2024 15:02:24 -0500 Subject: [PATCH] Add post-merge CI and build release workflows 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. --- .github/workflows/build_release.yml | 32 +++++++++++++++++++++++++++++ .github/workflows/pull_request.yml | 30 +++++++++++++++++---------- 2 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build_release.yml diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml new file mode 100644 index 00000000..c45dd6e4 --- /dev/null +++ b/.github/workflows/build_release.yml @@ -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 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 922f8b8f..75f18cdd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,8 +1,10 @@ -name: Pull request +name: Pull Request on: pull_request: types: [opened, reopened, synchronize] + push: + branches: [main] jobs: soundness: @@ -29,16 +31,22 @@ jobs: linux_pre_build_command: ((apt-get update && apt-get -y install curl make) || ((curl --help || yum -y install curl) && yum -y install make)) && ./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: echo "" - 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