mirror of
https://github.com/darwincereska/homebrew-software.git
synced 2026-02-12 04:04:41 -05:00
asrtar
This commit is contained in:
73
.github/workflows/bump-ttymer.yml
vendored
73
.github/workflows/bump-ttymer.yml
vendored
@@ -1,69 +1,51 @@
|
|||||||
name: Bump TTYmer
|
name: Bump TTYmer Formula
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # manual trigger
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 * * * *' # hourly check
|
- cron: '0 * * * *'
|
||||||
repository_dispatch:
|
|
||||||
types: [release]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bump-formula:
|
bump:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout tap repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Ruby (for Homebrew)
|
- name: Fetch latest release from GitHub
|
||||||
uses: ruby/setup-ruby@v1
|
id: fetch
|
||||||
with:
|
|
||||||
ruby-version: 3.1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: gem install --no-document toml-rb
|
|
||||||
|
|
||||||
- name: Fetch latest release tarball URL
|
|
||||||
id: release
|
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
result-encoding: string
|
result-encoding: json
|
||||||
script: |
|
script: |
|
||||||
const release = await github.rest.repos.getLatestRelease({
|
const release = await github.rest.repos.getLatestRelease({
|
||||||
owner: 'darwincereska',
|
owner: 'darwincereska',
|
||||||
repo: 'ttymer'
|
repo: 'ttymer'
|
||||||
});
|
});
|
||||||
return release.data.tarball_url;
|
return {
|
||||||
|
version: release.data.tag_name,
|
||||||
|
url: release.data.tarball_url
|
||||||
|
};
|
||||||
|
|
||||||
- name: Calculate SHA256 of tarball
|
- name: Download tarball and compute SHA256
|
||||||
id: sha256
|
id: compute
|
||||||
run: |
|
run: |
|
||||||
curl -L -o release.tar.gz "${{ steps.release.outputs.result }}"
|
curl -L -o ttymer.tar.gz "${{ steps.fetch.outputs.url }}"
|
||||||
SHA256=$(sha256sum release.tar.gz | awk '{ print $1 }')
|
SHA256=$(sha256sum ttymer.tar.gz | awk '{ print $1 }')
|
||||||
echo "hash=$SHA256" >> $GITHUB_OUTPUT
|
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Get release version
|
- name: Update Formula
|
||||||
id: version
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
result-encoding: string
|
|
||||||
script: |
|
|
||||||
const release = await github.rest.repos.getLatestRelease({
|
|
||||||
owner: 'darwincereska',
|
|
||||||
repo: 'ttymer'
|
|
||||||
});
|
|
||||||
return release.data.tag_name;
|
|
||||||
|
|
||||||
- name: Update formula file
|
|
||||||
run: |
|
run: |
|
||||||
VERSION=${{ steps.version.outputs.result }}
|
VERSION=${{ steps.fetch.outputs.version }}
|
||||||
SHA256=${{ steps.sha256.outputs.hash }}
|
SHA256=${{ steps.compute.outputs.sha256 }}
|
||||||
FORMULA_FILE=Formula/ttymer.rb
|
FORMULA=Formula/ttymer.rb
|
||||||
|
|
||||||
echo "Updating formula to version $VERSION with sha256 $SHA256"
|
echo "Updating $FORMULA to version $VERSION"
|
||||||
|
|
||||||
sed -i "s|url \".*\"|url \"https://github.com/darwincereska/ttymer/archive/refs/tags/${VERSION}.tar.gz\"|g" $FORMULA_FILE
|
sed -i "s|url \".*\"|url \"https://github.com/darwincereska/ttymer/archive/refs/tags/${VERSION}.tar.gz\"|g" "$FORMULA"
|
||||||
sed -i "s/sha256 \".*\"/sha256 \"${SHA256}\"/g" $FORMULA_FILE
|
sed -i "s/sha256 \".*\"/sha256 \"$SHA256\"/g" "$FORMULA"
|
||||||
sed -i "s/version \".*\"/version \"${VERSION#v}\"/g" $FORMULA_FILE || echo "No version line to update"
|
sed -i "s/version \".*\"/version \"${VERSION#v}\"/g" "$FORMULA" || echo "No version field to replace"
|
||||||
|
|
||||||
- name: Commit and push if changed
|
- name: Commit and push if changed
|
||||||
env:
|
env:
|
||||||
@@ -73,7 +55,8 @@ jobs:
|
|||||||
git config user.email "actions@github.com"
|
git config user.email "actions@github.com"
|
||||||
git add Formula/ttymer.rb
|
git add Formula/ttymer.rb
|
||||||
if ! git diff --cached --quiet; then
|
if ! git diff --cached --quiet; then
|
||||||
git commit -m "Auto-update to build ${{ steps.version.outputs.result }}"
|
VERSION=${{ steps.fetch.outputs.version }}
|
||||||
|
git commit -m "Auto-update ttymer to $VERSION"
|
||||||
git push
|
git push
|
||||||
else
|
else
|
||||||
echo "No changes to commit"
|
echo "No changes to commit"
|
||||||
|
|||||||
73
.github/workflows/bump-xswitcher.yml
vendored
73
.github/workflows/bump-xswitcher.yml
vendored
@@ -1,69 +1,51 @@
|
|||||||
name: Bump XSwitcher
|
name: Bump XSwitcher Formula
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # manual trigger
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 * * * *' # hourly check
|
- cron: '0 * * * *'
|
||||||
repository_dispatch:
|
|
||||||
types: [release]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bump-formula:
|
bump:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout tap repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Ruby (for Homebrew)
|
- name: Fetch latest release from GitHub
|
||||||
uses: ruby/setup-ruby@v1
|
id: fetch
|
||||||
with:
|
|
||||||
ruby-version: 3.1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: gem install --no-document toml-rb
|
|
||||||
|
|
||||||
- name: Fetch latest release tarball URL
|
|
||||||
id: release
|
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
result-encoding: string
|
result-encoding: json
|
||||||
script: |
|
script: |
|
||||||
const release = await github.rest.repos.getLatestRelease({
|
const release = await github.rest.repos.getLatestRelease({
|
||||||
owner: 'darwincereska',
|
owner: 'darwincereska',
|
||||||
repo: 'xswitcher'
|
repo: 'xswitcher'
|
||||||
});
|
});
|
||||||
return release.data.tarball_url;
|
return {
|
||||||
|
version: release.data.tag_name,
|
||||||
|
url: release.data.tarball_url
|
||||||
|
};
|
||||||
|
|
||||||
- name: Calculate SHA256 of tarball
|
- name: Download tarball and compute SHA256
|
||||||
id: sha256
|
id: compute
|
||||||
run: |
|
run: |
|
||||||
curl -L -o release.tar.gz "${{ steps.release.outputs.result }}"
|
curl -L -o xswitcher.tar.gz "${{ steps.fetch.outputs.url }}"
|
||||||
SHA256=$(sha256sum release.tar.gz | awk '{ print $1 }')
|
SHA256=$(sha256sum xswitcher.tar.gz | awk '{ print $1 }')
|
||||||
echo "hash=$SHA256" >> $GITHUB_OUTPUT
|
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Get release version
|
- name: Update Formula
|
||||||
id: version
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
with:
|
|
||||||
result-encoding: string
|
|
||||||
script: |
|
|
||||||
const release = await github.rest.repos.getLatestRelease({
|
|
||||||
owner: 'darwincereska',
|
|
||||||
repo: 'xswitcher'
|
|
||||||
});
|
|
||||||
return release.data.tag_name;
|
|
||||||
|
|
||||||
- name: Update formula file
|
|
||||||
run: |
|
run: |
|
||||||
VERSION=${{ steps.version.outputs.result }}
|
VERSION=${{ steps.fetch.outputs.version }}
|
||||||
SHA256=${{ steps.sha256.outputs.hash }}
|
SHA256=${{ steps.compute.outputs.sha256 }}
|
||||||
FORMULA_FILE=Formula/xswitcher.rb
|
FORMULA=Formula/xswitcher.rb
|
||||||
|
|
||||||
echo "Updating formula to version $VERSION with sha256 $SHA256"
|
echo "Updating $FORMULA to version $VERSION"
|
||||||
|
|
||||||
sed -i "s|url \".*\"|url \"https://github.com/darwincereska/xswitcher/archive/refs/tags/${VERSION}.tar.gz\"|g" $FORMULA_FILE
|
sed -i "s|url \".*\"|url \"https://github.com/darwincereska/xswitcher/archive/refs/tags/${VERSION}.tar.gz\"|g" "$FORMULA"
|
||||||
sed -i "s/sha256 \".*\"/sha256 \"${SHA256}\"/g" $FORMULA_FILE
|
sed -i "s/sha256 \".*\"/sha256 \"$SHA256\"/g" "$FORMULA"
|
||||||
sed -i "s/version \".*\"/version \"${VERSION#v}\"/g" $FORMULA_FILE || echo "No version line to update"
|
sed -i "s/version \".*\"/version \"${VERSION#v}\"/g" "$FORMULA" || echo "No version field to replace"
|
||||||
|
|
||||||
- name: Commit and push if changed
|
- name: Commit and push if changed
|
||||||
env:
|
env:
|
||||||
@@ -73,7 +55,8 @@ jobs:
|
|||||||
git config user.email "actions@github.com"
|
git config user.email "actions@github.com"
|
||||||
git add Formula/xswitcher.rb
|
git add Formula/xswitcher.rb
|
||||||
if ! git diff --cached --quiet; then
|
if ! git diff --cached --quiet; then
|
||||||
git commit -m "Auto-update to build ${{ steps.version.outputs.result }}"
|
VERSION=${{ steps.fetch.outputs.version }}
|
||||||
|
git commit -m "Auto-update xswitcher to $VERSION"
|
||||||
git push
|
git push
|
||||||
else
|
else
|
||||||
echo "No changes to commit"
|
echo "No changes to commit"
|
||||||
|
|||||||
Reference in New Issue
Block a user