diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml deleted file mode 100644 index d8e5a78..0000000 --- a/.github/workflows/push.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Build Go binaries - -# on: -# push: -# tags: -# - "*" # triggers only if push new tag version, like `0.8.4` or else - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - - name: Make binaries - uses: pcrandall/actions/golang-build@master - with: - github_token: ${{ secrets.GO_RELEASER_REPO_TOKEN }} - goos: ${{ matrix.goos }} - goarch: ${{ matrix.goarch }} - pre_command: go mod tidy - release_tag: v1.2 - binary_name: "mdclip" - extra_files: LICENSE README.md - args: linux/amd64 windows/amd64 windows/386 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 206fdf1..be7802f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,23 +1,41 @@ +# # .github/workflows/release.yaml - on: push: tags: - "*" # triggers only if push new tag version, like `0.8.4` or else # branches: [ master ] + #name: Create Release jobs: - releases-matrix: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GO_RELEASER_REPO_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + Changes in this Release + - Automatic builds with github actions + draft: false + prerelease: false + + releases-windows-matrix: name: Release Go Binary runs-on: ubuntu-latest strategy: matrix: # build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64 - goos: [windows, darwin] + goos: [windows] goarch: ["386", amd64] - exclude: - - goarch: "386" - goos: darwin steps: - uses: actions/checkout@v2 - uses: wangyoucao577/go-release-action@v1.18 @@ -26,6 +44,57 @@ jobs: goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} pre_command: go mod tidy - release_tag: v1.2 + release_tag: v1.1 binary_name: "mdclip" extra_files: LICENSE README.md + + releases-darwin-matrix: + name: Release Darwin Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64 + goos: [darwin] + goarch: [amd64] + steps: + - uses: actions/checkout@v2 + - uses: wangyoucao577/go-release-action@v1.18 + with: + github_token: ${{ secrets.GO_RELEASER_REPO_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + pre_command: apt-get install gcc-arm-linux-gnueabihf; export CROSS_COMPILE=arm-linux-gnueabihf- ; export CGO_ENABLED=1 + release_tag: v1.1 + binary_name: "mdclip" + extra_files: LICENSE README.md + + setup-linux: + name: setup Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: install xvfb libx11-dev + run: | + sudo apt update + sudo apt install -y xvfb libx11-dev + sudo apt-get clean + build-linux: + name: release Linux Go Binary + runs-on: ubuntu-latest + needs: setup-linux + strategy: + matrix: + os: [ubuntu-latest] + goos: [linux] + goarch: [amd64] + steps: + - uses: actions/checkout@v2 + - uses: wangyoucao577/go-release-action@v1.18 + with: + github_token: ${{ secrets.GO_RELEASER_REPO_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + pre_command: export CGO_ENABLED=0 + release_tag: v1.1 + binary_name: "mdclip" + extra_files: LICENSE README.md diff --git a/README.md b/README.md index 7be911b..d204305 100755 --- a/README.md +++ b/README.md @@ -4,13 +4,22 @@ Uses [clipboard API](https://github.com/golang-design/clipboard) to grab image f ![demo](./assets/demo.gif) -Installation: +Package installation go get -u https://github.com/pcrandall/mdclip -Manually install from releases page or use the below command - curl -s https://api.github.com/repos/pcrandall/mdclip/releases/latest | grep "browser_download_url" | cut -d '"' -f 4 | wget -qi - --output-document=mdclip +Install 64bit darwin + + curl -s https://api.github.com/repos/pcrandall/mdclip/releases/latest | grep "browser_download_url" | cut -d '"' -f 4 | grep darwin | grep amd64.zip$ | wget -qi - --output-document=mdclip.zip && unzip -o mdclip.zip && rm mdclip.zip + +Install 64bit windows + + curl -s https://api.github.com/repos/pcrandall/mdclip/releases/latest | grep "browser_download_url" | cut -d '"' -f 4 | grep windows | grep amd64.zip$ | wget -qi - --output-document=mdclip.zip && unzip -o mdclip.zip && rm mdclip.zip + +Install 32bit windows + + curl -s https://api.github.com/repos/pcrandall/mdclip/releases/latest | grep "browser_download_url" | cut -d '"' -f 4 | grep windows | grep 386.zip$ | wget -qi - --output-document=mdclip.zip && unzip -o mdclip.zip && rm mdclip.zip Dependency