v0.2.5 #20
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- aarch64-apple-darwin | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/cache_cargo | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- uses: actions-rs/[email protected] | |
with: | |
command: build | |
args: --release --target=${{ matrix.target }} | |
- run: | | |
mkdir oreq-${{ matrix.target }} | |
cp target/${{ matrix.target }}/release/oreq* oreq-${{ matrix.target }} | |
cp README.md oreq-${{ matrix.target }} | |
cp LICENSE oreq-${{ matrix.target }} | |
zip -r oreq-${{ matrix.target }} oreq-${{ matrix.target }} | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: build-${{ matrix.target }} | |
path: oreq-${{ matrix.target }}.zip | |
- run: | | |
shasum -a 256 oreq-${{ matrix.target }}.zip | cut -d" " -f1 > ${{ matrix.target }}.sum | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: checksum-${{ matrix.target }} | |
path: ${{ matrix.target }}.sum | |
create-release: | |
needs: [build] | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create release | |
run: | | |
gh release create ${{ github.ref_name }} \ | |
--generate-notes \ | |
--title ${{ github.ref_name }} \ | |
--target ${{ github.sha }} | |
upload-release: | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- aarch64-apple-darwin | |
needs: [create-release] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v1 | |
with: | |
name: build-${{ matrix.target }} | |
- name: upload release asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ github.ref_name }} ./build-${{ matrix.target }}/oreq-${{ matrix.target }}.zip | |
update-homebrew: | |
needs: [create-release] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v1 | |
with: | |
name: checksum-aarch64-apple-darwin | |
- id: checksum | |
run: | | |
SHA_256=$(cat checksum-aarch64-apple-darwin/aarch64-apple-darwin.sum) | |
echo "sha256=$SHA_256" >> $GITHUB_OUTPUT | |
- id: version | |
run: | | |
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g") | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- id: token | |
uses: ./.github/actions/generate_token | |
with: | |
app_id: ${{ secrets.TOKEN_APP_ID }} | |
private_key: ${{ secrets.PRIVATE_KEY }} | |
- uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ steps.token.outputs.token }} | |
repository: uzimaru0000/homebrew-tap | |
event-type: update-brew | |
client-payload: '{ "formula": "oreq", "description": "The tool for interactively creating curl arguments from OpenAPI.", "url": "https://github.com/uzimaru0000/oreq/releases/download/${{ steps.version.outputs.version }}/oreq-aarch64-apple-darwin.zip", "sha256": "${{ steps.checksum.outputs.sha256 }}", "version": "${{ steps.version.outputs.version }}" }' | |
publish-crates: | |
needs: [create-release] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/cache_cargo | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: actions-rs/[email protected] | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
with: | |
command: publish |