Compare commits
9 Commits
0defe68db8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d8c2b4dfa8 | |||
| 5b71ebf994 | |||
| 0cf501af3b | |||
| ba79226be6 | |||
| 37a147b4ad | |||
| bfab1bbc43 | |||
| da1ff9f82d | |||
| 128fbdb236 | |||
| 49ac141adb |
@@ -7,7 +7,7 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HOMEBREW_REPO: "git@gitea.skydust.fr:Skydust/homebrew-clearscript.git"
|
HOMEBREW_REPO: "https://gitea.skydust.fr/Skydust/homebrew-clearscript.git"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker:
|
build-docker:
|
||||||
@@ -22,34 +22,15 @@ jobs:
|
|||||||
- name: Update package version
|
- name: Update package version
|
||||||
run: |
|
run: |
|
||||||
log_info "Updating version in version.sh to $(yellow)$NEW_VERSION"
|
log_info "Updating version in version.sh to $(yellow)$NEW_VERSION"
|
||||||
sed -Ei "s|^(Version=\")[^\"]*|\1${NEW_VERSION}|" version.sh
|
sed -Ei "s|^(Version=\")[^\"]*|\1${NEW_VERSION}|" Clear.sh
|
||||||
cat version.sh
|
mkdir dist/ && cp -v Clear.sh README.md dist/
|
||||||
- name: TARRRRRRRR and push
|
- name: Publishing app version
|
||||||
run: |
|
uses: https://gitea.skydust.fr/actions/publish-skydust-app@main
|
||||||
PACKAGE_NAME="clearscript-v${NEW_VERSION}"
|
with:
|
||||||
log_info "Packaging app into $(yellow)${PACKAGE_NAME}"
|
appName: "brew-clearscript"
|
||||||
tar -zcf "${PACKAGE_NAME}.tar.gz" Clear.sh version.sh README.md
|
publishFolder: "./dist"
|
||||||
|
|
||||||
log_info "Sending package"
|
|
||||||
PKG_URL="${GITHUB_SERVER_URL}/api/packages/Skydust/generic/brew-clearscript/${NEW_VERSION}/package.tar.gz"
|
|
||||||
curl --user "MilaBot:${{ secrets.CI_TOKEN }}" \
|
|
||||||
--upload-file "${PACKAGE_NAME}.tar.gz" \
|
|
||||||
"${PKG_URL}"
|
|
||||||
|
|
||||||
echo "PKG_SHA=$(sha256 -q "${PACKAGE_NAME}.tar.gz" | tr -d '\n')" >> $GITEA_ENV
|
|
||||||
echo "PKG_URL=${PKG_URL}" >> $GITEA_ENV
|
|
||||||
- name: Update homebrew repo
|
- name: Update homebrew repo
|
||||||
run: |
|
run: |
|
||||||
git config user.email "release@example.com"
|
|
||||||
git config user.name "Release"
|
|
||||||
|
|
||||||
log_info "Overriding git repository auth with PAT"
|
|
||||||
repo_url="$(git remote get-url origin)"
|
|
||||||
repo_url="${repo_url#https://}" # Remove HTTPS
|
|
||||||
GIT_NEW_URL="https://MilaBot:${{ secrets.CI_TOKEN }}@${repo_url}.git"
|
|
||||||
git remote set-url origin "$GIT_NEW_URL"
|
|
||||||
git config --local --unset http.https://${GITHUB_SERVER_URL#https://}/.extraheader
|
|
||||||
|
|
||||||
log_info "Shallow cloning the brew repo $(yellow)${HOMEBREW_REPO}"
|
log_info "Shallow cloning the brew repo $(yellow)${HOMEBREW_REPO}"
|
||||||
git clone --depth 1 "${HOMEBREW_REPO}" ./brew_repo/
|
git clone --depth 1 "${HOMEBREW_REPO}" ./brew_repo/
|
||||||
cd brew_repo/
|
cd brew_repo/
|
||||||
@@ -58,7 +39,18 @@ jobs:
|
|||||||
sed -Ei "s|(url \")[^\"]*|\1${PKG_URL}|" Formula/clearscript.rb
|
sed -Ei "s|(url \")[^\"]*|\1${PKG_URL}|" Formula/clearscript.rb
|
||||||
sed -Ei "s|(sha256 \")[^\"]*|\1${PKG_SHA}|" Formula/clearscript.rb
|
sed -Ei "s|(sha256 \")[^\"]*|\1${PKG_SHA}|" Formula/clearscript.rb
|
||||||
cat Formula/clearscript.rb
|
cat Formula/clearscript.rb
|
||||||
|
echo
|
||||||
|
|
||||||
|
git config user.email "release@example.com"
|
||||||
|
git config user.name "Release"
|
||||||
|
|
||||||
|
log_info "Overriding git repository auth with PAT"
|
||||||
|
repo_url="$(git remote get-url origin)"
|
||||||
|
repo_url="${repo_url#https://}" # Remove HTTPS
|
||||||
|
GIT_NEW_URL="https://MilaBot:${{ secrets.CI_TOKEN }}@${repo_url}"
|
||||||
|
git remote set-url origin "$GIT_NEW_URL"
|
||||||
|
|
||||||
log_info "Pushing the new version"
|
log_info "Pushing the new version"
|
||||||
git add Formula
|
git add Formula
|
||||||
|
git commit -m "Updated version to v${NEW_VERSION}"
|
||||||
git push
|
git push
|
||||||
|
|||||||
2
Clear.sh
2
Clear.sh
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
source "./version.sh"
|
Version="2.0"
|
||||||
|
|
||||||
# ------ COLOR SETUP ------ #
|
# ------ COLOR SETUP ------ #
|
||||||
# Reset
|
# Reset
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
# shellcheck disable=SC2034
|
|
||||||
Version="2.0"
|
|
||||||
Reference in New Issue
Block a user