Auto-update homebrew formula on release (#122)

Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
This commit is contained in:
なつき 2022-12-08 12:21:48 -08:00 committed by GitHub
parent bec6b3da67
commit dfd4432f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View File

@ -302,6 +302,22 @@ jobs:
run: dart run grinder pkg-github-${{ matrix.platform }}
env: {GH_BEARER_TOKEN: "${{ github.token }}"}
deploy_homebrew:
name: "Deploy Homebrew"
runs-on: ubuntu-latest
needs: [dart_tests, sass_spec, static_analysis, format]
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'"
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- name: Deploy
run: dart pub run grinder pkg-homebrew-update
env:
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
GH_USER: sassbot
release_embedded_host:
name: "Release Embedded Host"
runs-on: ubuntu-latest

View File

@ -11,7 +11,15 @@ import 'package:yaml/yaml.dart';
import 'utils.dart';
void main(List<String> args) {
pkg.humanName.value = "Dart Sass Embedded";
pkg.botName.value = "Sass Bot";
pkg.botEmail.value = "sass.bot.beep.boop@gmail.com";
pkg.homebrewRepo.value = "sass/homebrew-sass";
pkg.homebrewFormula.value = "dart-sass-embedded.rb";
pkg.githubBearerToken.fn = () => Platform.environment["GH_BEARER_TOKEN"]!;
pkg.githubUser.fn = () => Platform.environment["GH_USER"];
pkg.githubPassword.fn = () => Platform.environment["GH_TOKEN"];
pkg.environmentConstants.fn = () => {
...pkg.environmentConstants.defaultValue,
@ -22,6 +30,7 @@ void main(List<String> args) {
};
pkg.addGithubTasks();
pkg.addHomebrewTasks();
grind(args);
}