Switch to Actions (#161)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-on: https://gitea.com/gitea/homebrew-gitea/pulls/161
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-committed-by: Jason Song <i@wolfogre.com>
This commit is contained in:
Jason Song 2023-04-21 21:46:03 +08:00 committed by techknowlogick
parent 13e1028c49
commit ee1a788402
11 changed files with 59 additions and 119 deletions

View File

@ -1,113 +0,0 @@
---
kind: pipeline
name: testing-amd64
platform:
os: linux
arch: amd64
trigger:
event:
- push
- pull_request
steps:
- name: test-versioned-formulae
image: homebrew/brew:3.6.14
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
commands:
- brew tap gitea/gitea "$${PWD}"
- brew install gitea/gitea/tea
- tea --version
- brew install gitea/gitea/gitea
- gitea --version
- name: test-head-formulae
image: homebrew/brew:latest
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
commands:
- brew tap gitea/gitea "$${PWD}"
- brew install gitea/gitea/tea-head
- tea --version
- brew install gitea/gitea/changelog
- changelog --version
- brew install gitea/gitea/gitea-head
- gitea --version
---
kind: pipeline
name: testing-arm64
platform:
os: linux
arch: arm64
trigger:
event:
- push
- pull_request
steps:
- name: test-versioned-formulae
image: markkrj/homebrew-arm:latest
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
commands:
- brew tap gitea/gitea "$${PWD}"
- brew install gitea/gitea/tea
- tea --version
- brew install gitea/gitea/gitea
- gitea --version
- name: test-head-formulae
image: markkrj/homebrew-arm:latest
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
commands:
- brew tap gitea/gitea "$${PWD}"
- brew install gitea/gitea/tea-head
- tea --version
- brew install gitea/gitea/changelog
- changelog --version
- brew install gitea/gitea/gitea-head
- gitea --version
---
kind: pipeline
name: update_version
platform:
os: linux
arch: amd64
trigger:
branch:
- main
event:
- cron
cron:
- update_version
steps:
- name: update
image: alpine:3.17
pull: always
commands:
- apk add --no-cache curl
- ./bump_version.sh
- name: push
image: appleboy/drone-git-push:0.2.3-linux-amd64
pull: always
settings:
author_email: "teabot@gitea.io"
author_name: GiteaBot
branch: main
commit: true
commit_message: "[skip ci] Updated Version via cron"
remote: "git@gitea.com:gitea/homebrew-gitea.git"
environment:
GIT_PUSH_SSH_KEY:
from_secret: git_push_ssh_key

32
.gitea/workflows/test.yml Normal file
View File

@ -0,0 +1,32 @@
name: test
on:
- pull_request
- push
jobs:
test:
strategy:
matrix:
brew_version: ["3.6.14", "latest"]
runs-on: ubuntu-latest
container:
image: homebrew/brew:${{ matrix.brew_version }}
env:
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- name: install node
# to use actions/checkout
run: |
brew install node
node --version
- uses: actions/checkout@v3
- name: test install
run: |
brew tap gitea/gitea "${PWD}"
brew install gitea/gitea/tea
tea --version
brew install gitea/gitea/gitea
gitea --version
# TODO: test for arm
# There is no arm image for homebrew/brew, and the image markkrj/homebrew-arm hasn't been updated for years

View File

@ -0,0 +1,21 @@
name: update
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: update
run: ./bump_version.sh
- name: commit
run: |
git config --global user.email "teabot@gitea.io"
git config --global user.name "GiteaBot"
git add --all
git commit -m "[skip ci] Updated Version via cron" || true
git push origin main

View File

@ -17,7 +17,7 @@ for bin in ${binaries};do
latest=$(curl -sL -o /dev/null -w %{url_effective} "${git_url}/releases/latest")
version="${latest##*/v}"
file_url="https://dl.gitea.io/${bin}/${version}"
file_url="https://dl.gitea.com/${bin}/${version}"
for os in ${supported_os}; do
sha256_file="${bin}-${version}-${os}"
if [ "$os" != "linux-386" -a "$os" != "linux-arm64" ]; then

View File

@ -15,7 +15,7 @@ class Changelog < Formula
end
@@filename = "changelog-#{version}-#{os}-#{arch}"
@@url = "https://dl.gitea.io/changelog-tool/#{version}/#{@@filename}"
@@url = "https://dl.gitea.com/changelog-tool/#{version}/#{@@filename}"
@@using = :nounzip
if os == "darwin-10.12" || arch == "amd64"

View File

@ -15,7 +15,7 @@ class GiteaHead < Formula
end
@@filename = "gitea-#{version}-#{os}-#{arch}"
@@url = "https://dl.gitea.io/gitea/#{version}/#{@@filename}"
@@url = "https://dl.gitea.com/gitea/#{version}/#{@@filename}"
@@using = :nounzip
if os == "darwin-10.12" || arch == "amd64"

View File

@ -15,7 +15,7 @@ class Gitea < Formula
end
@@filename = "gitea-#{version}-#{os}-#{arch}"
@@url = "https://dl.gitea.io/gitea/#{version}/#{@@filename}"
@@url = "https://dl.gitea.com/gitea/#{version}/#{@@filename}"
@@using = :nounzip
if os == "darwin-10.12" || arch == "amd64"

View File

@ -15,7 +15,7 @@ class TeaHead < Formula
end
@@filename = "tea-#{version}-#{os}-#{arch}"
@@url = "https://dl.gitea.io/tea/#{version}/#{@@filename}"
@@url = "https://dl.gitea.com/tea/#{version}/#{@@filename}"
@@using = :nounzip
if os == "darwin" || arch == "amd64"

2
tea.rb
View File

@ -15,7 +15,7 @@ class Tea < Formula
end
@@filename = "tea-#{version}-#{os}-#{arch}"
@@url = "https://dl.gitea.io/tea/#{version}/#{@@filename}"
@@url = "https://dl.gitea.com/tea/#{version}/#{@@filename}"
@@using = :nounzip
if os == "darwin" || arch == "amd64"