Skip to content

Commit

Permalink
ci(release): Try using tag and ref from otc-auth repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninja243 authored Oct 10, 2023
1 parent 89ef878 commit 2860cea
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,20 +270,33 @@ jobs:
runs-on: ubuntu-latest
needs: goreleaser
steps:
- uses: actions/checkout@v2
- name: Set output
id: vars
run: |
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "revision=$(git rev-list -n 1 ${RELEASE_VERSION})" >> $GITHUB_OUTPUT
- name: Checkout brew repo
uses: actions/checkout@v2
with:
repository: 'iits-consulting/homebrew-tap'
ref: main
fetch-depth: 0

- name: Update otc-auth Formula
working-directory: Formula
env:
TAG: ${{ steps.vars.outputs.tag }}
REVISION: ${{ steps.vars.outputs.revision }}
run: |
set -e
git fetch --tags
latest_tag=$(git describe --tags --abbrev=0)
revision=$(git rev-list -n 1 ${latest_tag})
echo -e 'class OtcAuth < Formula\n desc "Open Source CLI for the Open Telekom Cloud written in go"\n homepage "https://github.com/iits-consulting/otc-auth"\n url "https://github.com/iits-consulting/otc-auth.git",\n tag: "'${latest_tag}'",\n revision: "'${revision}'"\n license "GPLv3"\n head "https://github.com/iits-consulting/otc-auth.git", branch: "main"\n depends_on "bash" => :build\n depends_on "coreutils" => :build\n depends_on "go" => :build\n uses_from_macos "rsync" => :build\n def install\n system "go", "build", "-ldflags", "-X main.version=#{version} -X main.date=#{Date.today}"\n bin.install "./otc-auth"\n end\n test do\n run_output = shell_output("#{bin}/otc-auth version 2>&1")\n assert run_output.start_with?("OTC-Auth #{version}")\n end\nend' > otc-auth.rb
echo $TAG
echo $REVISION
echo ${{ steps.vars.outputs.tag }}
echo ${{ steps.vars.outputs.revision }}
echo -e 'class OtcAuth < Formula\n desc "Open Source CLI for the Open Telekom Cloud written in go"\n homepage "https://github.com/iits-consulting/otc-auth"\n url "https://github.com/iits-consulting/otc-auth.git",\n tag: "'${TAG}'",\n revision: "'${REVISION}'"\n license "GPLv3"\n head "https://github.com/iits-consulting/otc-auth.git", branch: "main"\n depends_on "bash" => :build\n depends_on "coreutils" => :build\n depends_on "go" => :build\n uses_from_macos "rsync" => :build\n def install\n system "go", "build", "-ldflags", "-X main.version=#{version} -X main.date=#{Date.today}"\n bin.install "./otc-auth"\n end\n test do\n run_output = shell_output("#{bin}/otc-auth version 2>&1")\n assert run_output.start_with?("OTC-Auth #{version}")\n end\nend' > otc-auth.rb
- name: Push to brew repo
uses: cpina/github-action-push-to-another-repository@main
Expand Down

0 comments on commit 2860cea

Please sign in to comment.