Skip to content

Commit

Permalink
Unfinished: Only bump formulae; don't generate them or store them in …
Browse files Browse the repository at this point in the history
…git.

Obtain version & revision from most recent version tag in the current branch, not from environment variable or argument.

Do not branch or commit on release.

Partial #638

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
  • Loading branch information
rgoldberg committed Nov 16, 2024
1 parent 36d40d9 commit 03de1d2
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 469 deletions.
103 changes: 16 additions & 87 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
dry_run: ${{ steps.dry_run.outputs.dry_run }}
mas_version: ${{ steps.mas_version.outputs.mas_version }}
pre_release: ${{ steps.pre_release.outputs.pre_release }}
release_branch: ${{ steps.release_branch.outputs.release_branch }}
tap_path: ${{ steps.tap_path.outputs.tap_path }}
steps:
# Logs event details and sets `DRY_RUN` env var
Expand Down Expand Up @@ -45,68 +44,19 @@ jobs:
run: |
echo "PRE_RELEASE=$(grep -q '-' <<<"${MAS_VERSION}" && echo 'true' || echo 'false')" >>"${GITHUB_OUTPUT}"
- id: release_branch
run: |
echo 'RELEASE_BRANCH=releases/release-${{ github.event.release.tag_name }}' >>"${GITHUB_OUTPUT}"
- id: tap_path
run: |
echo "TAP_PATH='$(brew --repo mas-cli/tap)'" >>"${GITHUB_OUTPUT}"
prepare-release:
runs-on: macos-15
needs: [start]
steps:
- uses: actions/checkout@v4
with:
# A fetch-depth of 0 includes all history and tags for script/version
fetch-depth: 0

- name: 👢 Bootstrap
run: |
script/bootstrap -f
- name: 🔀 Create mas release branch
env:
RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }}
run: |
git branch "${RELEASE_BRANCH}"
git switch "${RELEASE_BRANCH}"
- name: 🔖 Update version
env:
MAS_VERSION: ${{ needs.start.outputs.mas_version }}
run: |
script/version_bump "${MAS_VERSION}"
- name: 🔧 Configure Git Author
run: |
git config --global user.name 'masclibot'
git config --global user.email 'masclibot@users.noreply.github.com'
- name: 💾 Commit changes
env:
MAS_VERSION: ${{ needs.start.outputs.mas_version }}
RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }}
run: |
git add \
Homebrew/mas.rb \
Homebrew/mas-tap.rb \
Package.swift
git commit \
--message="🔖 Version ${MAS_VERSION}"
git push \
--set-upstream origin "${RELEASE_BRANCH}"
pkg-installer:
runs-on: macos-15
needs: [start, prepare-release]
needs: start
steps:
- uses: actions/checkout@v4
with:
# A fetch-depth of 0 includes all history and tags for script/version
fetch-depth: 0
ref: ${{ needs.start.outputs.release_branch }}
ref: ${{ needs.start.outputs.mas_version }}

- name: 👢 Bootstrap
run: |
Expand All @@ -126,22 +76,21 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
DRY_RUN: ${{ needs.start.outputs.dry_run }}
MAS_VERSION: ${{ needs.start.outputs.mas_version }}
if: ${{ needs.start.outputs.dry_run == 'false' }}
run: |
gh release upload "${MAS_VERSION}" \
gh release upload '${{ needs.start.outputs.mas_version }}' \
.build/mas.pkg
homebrew-tap:
runs-on: macos-15
needs: [start, prepare-release]
needs: start
steps:
- name: 📺 Checkout mas repo
uses: actions/checkout@v4
with:
# A fetch-depth of 0 includes all history and tags for script/version
fetch-depth: 0
ref: ${{ needs.start.outputs.release_branch }}
ref: ${{ needs.start.outputs.mas_version }}

- name: 👢 Bootstrap
run: |
Expand Down Expand Up @@ -179,60 +128,42 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
DRY_RUN: ${{ needs.start.outputs.dry_run }}
RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }}
MAS_VERSION: ${{ needs.start.outputs.mas_version }}
working-directory: ${{ needs.start.outputs.tap_path }}
run: |
git branch "${RELEASE_BRANCH}"
git switch "${RELEASE_BRANCH}"
cp -v \
"${GITHUB_WORKSPACE}/Homebrew/mas-tap.rb" \
Formula/mas.rb
git add Formula/mas.rb
git commit --message="🔖 Version ${MAS_VERSION}"
git push \
--set-upstream origin "${RELEASE_BRANCH}"
gh pr create \
--assignee phatblat \
--base main \
--head "${RELEASE_BRANCH}" \
--title "🔖 Version ${MAS_VERSION}" \
--body "This PR contains the changes from releasing version \
[${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})."
brew bump-formula-pr \
--strict \
--online \
--tag '${{ needs.start.outputs.mas_version }}' \
--revision "$(git rev-list -n 1 '${{ needs.start.outputs.mas_version }}')" \
mas-cli/tap/mas
- name: 🚰 Update mas tap formula
env:
GH_TOKEN: ${{ github.token }}
DRY_RUN: ${{ needs.start.outputs.dry_run }}
MAS_VERSION: ${{ needs.start.outputs.mas_version }}
run: |
DRY_RUN="${DRY_RUN}" \
script/brew_tap_update "${MAS_VERSION}"
script/bottle
- name: 🚀 Upload Bottles
env:
GH_TOKEN: ${{ github.token }}
DRY_RUN: ${{ needs.start.outputs.dry_run }}
MAS_VERSION: ${{ needs.start.outputs.mas_version }}
if: ${{ needs.start.outputs.dry_run == 'false' }}
run: |
gh release upload "${MAS_VERSION}" \
gh release upload '${{ needs.start.outputs.mas_version }}' \
.build/bottles/mas-*.bottle.tar.gz
homebrew-core:
runs-on: macos-15
needs: [start, prepare-release, homebrew-tap]
needs: [start, homebrew-tap]
if: ${{ needs.start.outputs.pre_release == 'false' }}
steps:
- uses: actions/checkout@v4
with:
# A fetch-depth of 0 includes all history and tags for script/version
fetch-depth: 0
ref: ${{ needs.start.outputs.release_branch }}
ref: ${{ needs.start.outputs.mas_version }}

- name: 👢 Bootstrap
run: |
Expand All @@ -248,7 +179,5 @@ jobs:
GH_TOKEN: ${{ github.token }}
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
DRY_RUN: ${{ needs.start.outputs.dry_run }}
MAS_VERSION: ${{ needs.start.outputs.mas_version }}
run: |
DRY_RUN="${DRY_RUN}" \
script/brew_core_update "${MAS_VERSION}"
DRY_RUN="${DRY_RUN}" script/brew_core_update
1 change: 0 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
brew "act"
brew "markdownlint-cli"
brew "prettier"
brew "sd"
brew "shellcheck"
brew "shfmt"
brew "swift-format"
Expand Down
49 changes: 0 additions & 49 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,55 +40,6 @@
}
}
},
"sd": {
"version": "1.0.0",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_sequoia": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:3cf7ab4495f622a4f245bb1c7c30225ef881dc390ee5edc59a1d3c4381cecca1",
"sha256": "3cf7ab4495f622a4f245bb1c7c30225ef881dc390ee5edc59a1d3c4381cecca1"
},
"arm64_sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:6bc773a70934364157591cd888e617601a42ed1f615fda8f77364fa45631d08d",
"sha256": "6bc773a70934364157591cd888e617601a42ed1f615fda8f77364fa45631d08d"
},
"arm64_ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:946a44f567e3528d380fbbee742c3abeed9952f53f7de172a846b63d2e21d5b1",
"sha256": "946a44f567e3528d380fbbee742c3abeed9952f53f7de172a846b63d2e21d5b1"
},
"arm64_monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:60f079d38aa238a1e7109c6a0f988fe7033449d20f05db3b87219cbfd945fe58",
"sha256": "60f079d38aa238a1e7109c6a0f988fe7033449d20f05db3b87219cbfd945fe58"
},
"sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:f83ebe2505106e8c94c4b92d15c0ac3390dc637039043dbafad3e382fa8c61b0",
"sha256": "f83ebe2505106e8c94c4b92d15c0ac3390dc637039043dbafad3e382fa8c61b0"
},
"ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:0200b81c386198d39ed7b03e85c771e141d9604075d82aa4caed5d5a775486c8",
"sha256": "0200b81c386198d39ed7b03e85c771e141d9604075d82aa4caed5d5a775486c8"
},
"monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:a8fee9e7b0202a27d8dcc599ebd391637107134f139dbe88d6b22c880e63d8a1",
"sha256": "a8fee9e7b0202a27d8dcc599ebd391637107134f139dbe88d6b22c880e63d8a1"
},
"x86_64_linux": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:4c098bdfaff013f7a6b6b96a65b9cfef86926e1cd901b363e1bdb84734ee6e3f",
"sha256": "4c098bdfaff013f7a6b6b96a65b9cfef86926e1cd901b363e1bdb84734ee6e3f"
}
}
}
},
"shellcheck": {
"version": "0.10.0",
"bottle": {
Expand Down
34 changes: 0 additions & 34 deletions Homebrew/mas-tap.rb

This file was deleted.

41 changes: 0 additions & 41 deletions Homebrew/mas.rb

This file was deleted.

Loading

0 comments on commit 03de1d2

Please sign in to comment.