-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b64a7ae
commit 2fcaebf
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
# Delete whichever of these you aren't using. | ||
- master | ||
|
||
jobs: | ||
|
||
# Jobs go here. Most of is article is about things | ||
# to put in this section. | ||
build-macos: | ||
name: "Build on macOS" | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
# components: rustfmt, clippy | ||
- run: cargo check | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Homebrew | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
homebrew: | ||
name: "Create homebrew release" | ||
runs-on: macos-latest | ||
steps: | ||
- name: Get tag | ||
id: push | ||
run: | | ||
echo ::set-output name=name::${GITHUB_REF#refs/*/} | ||
echo ::set-output name=branch::${GITHUB_REF#refs/heads/} | ||
echo ::set-output name=tag::${GITHUB_REF#refs/tags/} | ||
- uses: actions/checkout@v2 | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
|
||
- name: Run cargo build --release | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
|
||
- name: Homebrew archive and shasum | ||
id: archive | ||
run: | | ||
cd target/release | ||
tar -czf dark-notify-${{ steps.push.outputs.tag }}.tar.gz dark-notify | ||
SUM=$(shasum -a 256 dark-notify-${{ steps.push.outputs.tag }}.tar.gz | awk '{print $1}') | ||
echo "::set-output name=shasum::$SUM" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.push.outputs.tag }} | ||
release_name: Release ${{ steps.push.outputs.tag }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
id: upload_release_asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: target/release/dark-notify-${{ steps.push.outputs.tag }}.tar.gz | ||
asset_name: dark-notify-${{ steps.push.outputs.tag }}.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
- name: Update Homebrew formula | ||
env: | ||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREW_TOKEN }} | ||
run: | | ||
brew tap cormacrelf/tap | ||
brew bump-formula-pr -f --no-browse --no-audit \ | ||
--version='${{ steps.push.outputs.tag }}' \ | ||
--sha256='${{ steps.archive.outputs.shasum }}' \ | ||
--url='${{ steps.upload_release_asset.outputs.browser_download_url }}' \ | ||
cormacrelf/tap/dark-notify | ||