v0.25.4 #351
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
- uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: "22.x" | |
registry-url: "https://registry.npmjs.org" | |
scope: "@fsouza" | |
- run: yarn install --frozen-lockfile | |
- run: yarn publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
update-brew-formula: | |
name: update-brew-formula | |
runs-on: macos-latest | |
needs: | |
- release | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
with: | |
ref: main | |
repository: fsouza/homebrew-prettierd | |
token: ${{ secrets.GH_TOKEN_BREW_TAP }} | |
- run: brew install sd | |
- name: set git config | |
run: | | |
git config user.name fsouzabot | |
git config user.email 'fsouzabot@users.noreply.github.com' | |
- name: update formula file | |
id: update-formula-file | |
run: | | |
tarball_url=$(npm view @fsouza/prettierd dist.tarball) | |
checksum=$(curl -sL "${tarball_url}" | shasum -a 256 - | awk '{print $1}') | |
sd 'url ".+"' 'url "'${tarball_url}'"' Formula/prettierd.rb | |
sd 'sha256 ".+"' 'sha256 "'${checksum}'"' Formula/prettierd.rb | |
version=$(echo "${tarball_url}" | sd '^.+/-/prettierd-(.+)\.tgz$' '$1') | |
echo "version=${version}" >> "${GITHUB_OUTPUT}" | |
- name: test formula | |
run: | | |
brew install --formulae --include-test ./Formula/prettierd.rb | |
brew test ./Formula/prettierd.rb | |
- name: commit and push | |
run: | | |
git commit -m "prettierd v${VERSION}" Formula/prettierd.rb | |
git push origin main | |
env: | |
VERSION: ${{ steps.update-formula-file.outputs.version }} |