Odin configure modify #180
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: odin-release | ||
on: | ||
pull_request: | ||
types: [closed] | ||
jobs: | ||
release: | ||
name: odin-release | ||
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- id: changed_files | ||
uses: jitterbit/get-changed-files@v1 | ||
- name: Check commit details | ||
id: commit | ||
run: | | ||
echo "::set-output name=version::$(go run cmd/getVersion.go)" | ||
echo "::set-output name=changelog::$(git log --pretty='- %s')" | ||
- name: Create Tag | ||
uses: negz/create-tag@v1 | ||
with: | ||
version: ${{ steps.commit.outputs.version }} | ||
message: ${{ steps.commit.outputs.version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.17.1' | ||
- name: Create Release Asset | ||
run: | | ||
make compressed-builds | ||
- name: Generate Asset SHA256 | ||
id: sha256 | ||
run: | | ||
echo "::set-output name=darwin_amd64::$(shasum -a 256 bin/odin_darwin_amd64.tar.gz | cut -d' ' -f1)" | ||
echo "::set-output name=darwin_arm64::$(shasum -a 256 bin/odin_darwin_arm64.tar.gz | cut -d' ' -f1)" | ||
echo "::set-output name=linux_amd64::$(shasum -a 256 bin/odin_linux_amd64.tar.gz | cut -d' ' -f1)" | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
name: Release ${{ steps.commit.outputs.version }} | ||
tag: ${{ steps.commit.outputs.version }} | ||
artifacts: "bin/*.tar.gz" | ||
body: | | ||
### Changelog: | ||
${{ steps.commit.outputs.changelog }} | ||
--- | ||
### Assets | ||
#### Darwin AMD64 | ||
- Asset Url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_darwin_amd64.tar.gz | ||
- SHA Checksum: `${{ steps.sha256.outputs.darwin_amd64 }}` | ||
#### Darwin ARM64 | ||
- Asset Url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_darwin_arm64.tar.gz | ||
- SHA Checksum: `${{ steps.sha256.outputs.darwin_arm64 }}` | ||
#### Linux AMD64 | ||
- Asset Url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_linux_amd64.tar.gz | ||
- SHA Checksum: `${{ steps.sha256.outputs.linux_amd64 }}` | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout create-homebrew-release action | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: dream11/create-homebrew-release | ||
path: homebrew-release | ||
token: ${{ secrets.COMMIT_ACCESS_TOKEN }} | ||
ref: "v1.0.0" | ||
- name: Create homebrew release | ||
id: homebrew_release | ||
uses: ./homebrew-release/ | ||
with: | ||
homebrew-tap: dream11/homebrew-tools | ||
formula_directory: formula | ||
description: "Interface for service definitions & deployments into self-managed environments" | ||
formula: odin | ||
version: ${{ steps.commit.outputs.version }} | ||
homepage: https://github.com/dream11/odin | ||
github-token: ${{ secrets.COMMIT_ACCESS_TOKEN }} | ||
github-username: dream11bot | ||
github-email: [email protected] | ||
darwin-amd64-url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_darwin_amd64.tar.gz | ||
darwin-amd64-sha: ${{ steps.sha256.outputs.darwin_amd64 }} | ||
darwin-arm64-url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_darwin_arm64.tar.gz | ||
darwin-arm64-sha: ${{ steps.sha256.outputs.darwin_arm64 }} | ||
linux-amd64-url: https://github.com/dream11/odin/releases/download/${{ steps.commit.outputs.version }}/odin_linux_amd64.tar.gz | ||
linux-amd64-url: ${{ steps.sha256.outputs.linux_amd64 }} | ||
merge-pr: false | ||
- name: Comment homebrew-tools generated PR | ||
uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
## Yay! Homebrew tools PR created. URL: ${{ steps.homebrew_release.outputs.pr }} :smile: | ||
repo-token: ${{ secrets.COMMIT_ACCESS_TOKEN }} |