diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..9f2b9f42 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,58 @@ +name: CD + +on: + push: + branches: [ '*' ] + # push: + # tags: + # - '*' + +jobs: + release-osx: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + # - name: Build + # run: cargo build + # - name: Run tests + # run: make test + # - name: Run clippy + # run: make clippy + - name: Build Release + run: make build-release + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: true + + - name: Set SHA + id: shasum + run: | + echo ::set-output name=sha::"$(shasum -a 256 ./target/gitui-mac.tar.gz | awk '{printf $1}')" + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./target/gitui-mac.tar.gz + asset_name: gitui-mac.tar.gz + asset_content_type: application/gzip + + - name: Bump Brew + env: + HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREW_TOKEN }} + run: | + brew tap extrawurst/tap + brew bump-formula-pr -f --version=v0.2.0 --no-browse --no-audit \ + --sha256=${{ steps.shasum.outputs.sha }} \ + --url="https://github.com/extrawurst/gitui/releases/download/refs%2Fheads%2Fcd-pipeline/gitui-mac.tar.gz" \ + extrawurst/tap/gitui \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8246045..854a7af3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,9 +21,9 @@ jobs: - name: Build run: cargo build - name: Run tests - run: cargo test --workspace + run: make test - name: Run clippy - run: cargo clean && cargo clippy --all-features + run: make clippy - name: Security audit uses: actions-rs/audit-check@v1 with: