From 6eb1e8be70e5f1fda32d9797c4aa41accf2469f6 Mon Sep 17 00:00:00 2001 From: Sam Coe Date: Wed, 17 Nov 2021 13:16:52 -0800 Subject: [PATCH] Remove old flow now that gh 2.2.0 supports directly dispatching binary extensions --- .github/workflows/release.yml | 20 +---------- .goreleaser.yml | 2 +- gh-repo-explore | 65 ----------------------------------- 3 files changed, 2 insertions(+), 85 deletions(-) delete mode 100755 gh-repo-explore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99bdbc3..d52311c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,6 @@ on: tags: - "v*" -permissions: - contents: write - jobs: goreleaser: runs-on: ubuntu-latest @@ -25,7 +22,7 @@ jobs: - name: Import GPG key id: import_gpg - uses: crazy-max/ghaction-import-gpg@v3 + uses: crazy-max/ghaction-import-gpg@v4 with: gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} @@ -39,18 +36,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} - - - name: Update version - env: - GIT_COMMITTER_NAME: Actions Automation - GIT_COMMITTER_EMAIL: - GIT_AUTHOR_NAME: Actions Automation - GIT_AUTHOR_EMAIL: - run: | - tag="${GITHUB_REF#refs/tags/}" - sed -i -e "s/^tag=.*/tag=\"${tag}\"/" gh-repo-explore - git add gh-repo-explore - git commit -m "Update version to ${tag}" - if [[ $GITHUB_REF != *-* ]]; then - git push origin HEAD:trunk - fi diff --git a/.goreleaser.yml b/.goreleaser.yml index 1b8d1fe..d00de6e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,7 +16,7 @@ builds: - amd64 archives: - format: binary - name_template: "{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}" + name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}" checksum: disable: false signs: diff --git a/gh-repo-explore b/gh-repo-explore deleted file mode 100755 index a2d8816..0000000 --- a/gh-repo-explore +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash -set -e - -tag="v0.0.4" -repo="samcoe/gh-repo-explore" -extension_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -tag_path="${extension_path}/dist/${tag}" -exe="gh-repo-explore" -platform="" -extension="" - -determine_platform() { - local arch - arch="$(uname -m)" - if uname -a | grep Msys > /dev/null; then - extension=".exe" - if [ "$arch" == "x86_64" ]; then - platform="windows_amd64" - elif [ "$arch" == "i686" ]; then - platform="windows_386" - elif [ "$arch" == "i386" ]; then - platform="windows_386" - fi - elif uname -a | grep Darwin > /dev/null; then - if [ "$arch" == "x86_64" ]; then - platform="darwin_amd64" - fi - elif uname -a | grep Linux > /dev/null; then - if [ "$arch" == "x86_64" ]; then - platform="linux_amd64" - elif [ "$arch" == "i686" ]; then - platform="linux_386" - elif [ "$arch" == "i386" ]; then - platform="linux_386" - fi - fi -} - -download_latest_release() { - mkdir -p "${tag_path}" - gh release -R"${repo}" download "${tag}" --pattern "*${platform}*" --dir="${tag_path}" - mv "${tag_path}/${exe}_${tag}_${platform}${extension}" "${tag_path}/${exe}" - chmod +x "${tag_path}/${exe}" -} - -if [ ! -e "${tag_path}/${exe}" ]; then - determine_platform - - if [ "${platform}" == "" ]; then - if [ "$(which go)" == "" ]; then - echo "go must be installed to use this gh extension on this platform" - exit 1 - fi - mkdir -p "${tag_path}" - pushd "${extension_path}" > /dev/null - go build -o "${tag_path}/${exe}" - popd > /dev/null - else - if [ ! -d "${tag_path}" ]; then - download_latest_release - fi - fi -fi - -exec "${tag_path}/${exe}" "$@"