Files
SwiftLint/.github/workflows/post-release.yml

120 lines
3.8 KiB
YAML

name: Post Release
on:
release:
types: published
jobs:
setup-credentials:
name: Setup Actor Credentials
uses: ./.github/workflows/actor-credentials.yml
with:
actor: ${{ github.event.release.author.login }}
permissions:
contents: write
secrets: inherit
merge-into-main:
name: Merge into main
needs: setup-credentials
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: main
token: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', needs.setup-credentials.outputs.author_uppercase)] }}
persist-credentials: true
- name: Configure Git author
uses: Homebrew/actions/git-user-config@main
with:
token: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', needs.setup-credentials.outputs.author_uppercase)] }}
- name: Merge release branch
run: |
git fetch origin "release/${TAG_NAME}"
git merge --ff-only "origin/release/${TAG_NAME}"
git push origin main
git push origin --delete "release/${TAG_NAME}"
env:
TAG_NAME: ${{ github.event.release.tag_name }}
publish-pod:
name: Publish Pod
needs:
- merge-into-main
- setup-credentials
runs-on: macOS-14
permissions:
contents: read
steps:
- &checkout-step
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ github.event.release.tag_name }}
persist-credentials: false
- name: Deploy to CocoaPods
run: make pod_publish
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app
COCOAPODS_TRUNK_TOKEN: ${{ secrets[format('COCOAPODS_TRUNK_TOKEN_{0}', needs.setup-credentials.outputs.author_uppercase)] }}
dispatch-plugins:
name: Dispatch Plugins Repository
needs: merge-into-main
runs-on: ubuntu-slim
permissions:
contents: read
steps:
- *checkout-step
- name: Parse checksum
id: parse_checksum
run: echo "checksum=$(grep -o '[a-fA-F0-9]\{64\}' Package.swift)" >> "$GITHUB_OUTPUT"
- name: Dispatch release of plugins package
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ secrets.SIMPLYDANNY_PLUGINS_SYNC }}
repository: SimplyDanny/SwiftLintPlugins
event-type: swiftlint-release
client-payload: |-
{
"title": "${{ github.event.release.name }}",
"tag": "${{ github.event.release.tag_name }}",
"checksum": "${{ steps.parse_checksum.outputs.checksum }}",
"prerelease": ${{ github.event.release.prerelease }}
}
bump-homebrew:
name: Bump Homebrew Formula
needs:
- merge-into-main
- setup-credentials
runs-on: ubuntu-24.04
container:
image: ghcr.io/homebrew/ubuntu24.04:latest
permissions: {}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@main
- name: Configure Git author
uses: Homebrew/actions/git-user-config@main
with:
token: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', needs.setup-credentials.outputs.author_uppercase)] }}
- name: Update Homebrew formula
uses: Homebrew/actions/bump-packages@main
with:
token: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', needs.setup-credentials.outputs.author_uppercase)] }}
formulae: swiftlint
build-docker:
name: Build Docker Images
needs: merge-into-main
uses: ./.github/workflows/docker.yml
permissions:
contents: read
packages: write
secrets: inherit
with:
tag: ${{ github.event.release.tag_name }}