Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,59 @@ jobs:
- name: Test
run: cd teloc_macros && cargo test

release-github:
name: Release on GitHub
permissions:
contents: read
deployments: write
needs:
- code-checks-teloc
- code-checks-macros
- test-teloc
- build-macro
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Parse release version
id: release
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Verify release version matches `teloc_macros` Cargo manifest
run: >-
test "${{ steps.release.outputs.VERSION }}" \
== "$(grep -m1 'version = "' teloc_macros/Cargo.toml | cut -d '"' -f2)"
- name: Verify release version matches `teloc` Cargo manifest
run: >-
test "${{ steps.release.outputs.VERSION }}" \
== "$(grep -m1 'version = "' teloc/Cargo.toml | cut -d '"' -f2)"
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ steps.release.outputs.VERSION }}
body: |
[API docs](https://docs.rs/cucumber/${{ steps.release.outputs.VERSION }})
prerelease: ${{ contains(steps.release.outputs.VERSION, '-') }}

release-crate:
name: Release on crates.io
needs: ["release-github"]
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Publish `teloc_macros` crate
run: cargo publish -p teloc_macros
--token ${{ secrets.CRATESIO_TOKEN }}

- name: Wait crates.io index is updated
run: sleep 120

- name: Publish `teloc` crate
run: cargo publish -p teloc
--token ${{ secrets.CRATESIO_TOKEN }}