From 27f5287c820badbe381e0054f004d31505f203d4 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 18 Dec 2022 21:27:21 +0100 Subject: [PATCH] chore(release) with renamed release --- .github/workflows/homebrew-release.yml | 89 -------------------------- .github/workflows/release.yml | 87 ++++++++++++++++++++++++- 2 files changed, 85 insertions(+), 91 deletions(-) delete mode 100644 .github/workflows/homebrew-release.yml diff --git a/.github/workflows/homebrew-release.yml b/.github/workflows/homebrew-release.yml deleted file mode 100644 index 88a08a3..0000000 --- a/.github/workflows/homebrew-release.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: release -on: - push: - branches: - - main - - next - pull_request: - workflow_dispatch: - -env: - CARGO_INCREMENTAL: 0 - -jobs: - homebrew-release: - runs-on: ubuntu-latest - name: Homebrew releaser - permissions: - contents: write - steps: - - name: Release to homebrew tap - uses: Justintime50/homebrew-releaser@v1 - if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }} - with: - # The name of the homebrew tap to publish your formula to as it appears on GitHub. - # Required - strings. - homebrew_owner: kjuulh - homebrew_tap: brew - - # The name of the folder in your homebrew tap where formula will be committed to. - # Default is shown - string. - formula_folder: toolkit - - # The GitHub Token (saved as a repo secret) that has `repo` permissions for the homebrew tap you want to release to. - # Required - string. - github_token: ${{ secrets.GITHUB_TOKEN }} - - # Git author info used to commit to the homebrew tap. - # Defaults are shown - strings. - commit_owner: homebrew-releaser - commit_email: homebrew-releaser@kjuulh.io - - # Custom dependencies in case other formulas are needed to build the current one. - # Optional - multiline string. - #depends_on: | - - # Custom install command for your formula. - # Required - string. - install: 'bin.install "toolkit" => "toolkit"' - - # Custom test command for your formula so you can run `brew test`. - # Optional - string. - #test: 'assert_match("my script output", shell_output("my-script-command"))' - - # Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes - # a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized): - # https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz' - # Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz - # Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz - # Optional - booleans. - target_darwin_amd64: true - target_darwin_arm64: true - target_linux_amd64: true - target_linux_arm64: true - - # Update your homebrew tap's README with a table of all projects in the tap. - # This is done by pulling the information from all your formula.rb files - eg: - # - # | Project | Description | Install | - # | ------------------------------------------ | ------------ | ------------------------ | - # | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` | - # | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` | - # | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` | - # - # Simply place the following in your README or wrap your project in these comment tags: - # - # TABLE HERE - # - # - # Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you. - # Default is `false` - boolean. - update_readme_table: true - - # Skips committing the generated formula to a homebrew tap (useful for local testing). - # Default is shown - boolean. - skip_commit: false - - # Logs debugging info to console. - # Default is shown - boolean. - debug: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 613c9a9..7a39a1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,19 +22,25 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-musl + release-target: linux-amd64 deb: true - os: ubuntu-latest target: arm-unknown-linux-musleabihf + release-target: linux-arm - os: ubuntu-latest target: armv7-unknown-linux-musleabihf + release-target: linux-arm7 - os: ubuntu-latest target: aarch64-unknown-linux-musl + release-target: linux-arm64 deb: true - os: macos-11 target: x86_64-apple-darwin + release-target: darwin-amd64 - os: macos-11 target: aarch64-apple-darwin + release-target: darwin-arm64 steps: - name: Checkout repository uses: actions/checkout@v2 @@ -86,11 +92,11 @@ jobs: man/ -C target/${{ matrix.target }}/release/ toolkit | gzip --best - > 'toolkit-${{ steps.get_version.outputs.value }}-${{ matrix.target }}.tar.gz' + > 'toolkit-${{ steps.get_version.outputs.value }}-${{ matrix.release-target }}.tar.gz' - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: ${{ matrix.target }} + name: ${{ matrix.release-target }} path: | *.deb *.tar.gz @@ -106,3 +112,80 @@ jobs: *.zip name: ${{ steps.get_version.outputs.value }} tag_name: "" + brew-releaser: + name: Homebrew releaser + needs: [release] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Release to homebrew tap + uses: Justintime50/homebrew-releaser@v1 + if: ${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)') }} + with: + # The name of the homebrew tap to publish your formula to as it appears on GitHub. + # Required - strings. + homebrew_owner: kjuulh + homebrew_tap: brew + + # The name of the folder in your homebrew tap where formula will be committed to. + # Default is shown - string. + formula_folder: toolkit + + # The GitHub Token (saved as a repo secret) that has `repo` permissions for the homebrew tap you want to release to. + # Required - string. + github_token: ${{ secrets.GITHUB_TOKEN }} + + # Git author info used to commit to the homebrew tap. + # Defaults are shown - strings. + commit_owner: homebrew-releaser + commit_email: homebrew-releaser@kjuulh.io + + # Custom dependencies in case other formulas are needed to build the current one. + # Optional - multiline string. + #depends_on: | + + # Custom install command for your formula. + # Required - string. + install: 'bin.install "toolkit" => "toolkit"' + + # Custom test command for your formula so you can run `brew test`. + # Optional - string. + #test: 'assert_match("my script output", shell_output("my-script-command"))' + + # Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes + # a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized): + # https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz' + # Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz + # Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz + # Optional - booleans. + target_darwin_amd64: true + target_darwin_arm64: true + target_linux_amd64: true + target_linux_arm64: true + + # Update your homebrew tap's README with a table of all projects in the tap. + # This is done by pulling the information from all your formula.rb files - eg: + # + # | Project | Description | Install | + # | ------------------------------------------ | ------------ | ------------------------ | + # | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` | + # | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` | + # | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` | + # + # Simply place the following in your README or wrap your project in these comment tags: + # + # TABLE HERE + # + # + # Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you. + # Default is `false` - boolean. + update_readme_table: true + + # Skips committing the generated formula to a homebrew tap (useful for local testing). + # Default is shown - boolean. + skip_commit: false + + # Logs debugging info to console. + # Default is shown - boolean. + debug: false