-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Switch to release please and github actions (#62)
- Loading branch information
Showing
15 changed files
with
194 additions
and
92 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Build Documentation | ||
description: 'Build Documentation.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build Documentation | ||
shell: bash | ||
run: cargo doc --no-deps -p eventsource-client |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI Workflow | ||
description: 'Shared CI workflow.' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Check formatting | ||
shell: bash | ||
run: cargo fmt --check | ||
|
||
- name: Run tests | ||
shell: bash | ||
run: cargo test --all-features -p eventsource-client | ||
|
||
- name: Run clippy checks | ||
shell: bash | ||
run: cargo clippy --all-features -p eventsource-client -- -D warnings | ||
|
||
- name: Build contract tests | ||
shell: bash | ||
run: make build-contract-tests | ||
|
||
- name: Start contract test service | ||
shell: bash | ||
run: make start-contract-test-service-bg | ||
|
||
- name: Run contract tests | ||
shell: bash | ||
run: make run-contract-tests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Publish Package | ||
description: 'Publish the package to crates.io' | ||
inputs: | ||
token: | ||
description: 'Token to use for publishing.' | ||
required: true | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Publish Library | ||
shell: bash | ||
if: ${{ inputs.dry_run == 'false' }} | ||
run: CARGO_REGISTRY_TOKEN="${{inputs.token}}" cargo publish -p eventsource-client |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Run CI | ||
on: | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' # Do not need to run CI for markdown changes. | ||
pull_request: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
ci-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- name: Setup rust tooling | ||
run: | | ||
rustup override set 1.68 | ||
rustup component add rustfmt clippy | ||
- uses: ./.github/actions/ci | ||
- uses: ./.github/actions/build-docs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Lint PR title | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
lint-pr-title: | ||
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Publish Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
|
||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-latest | ||
# Needed to get tokens during publishing. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup rust tooling | ||
run: | | ||
rustup override set 1.68 | ||
rustup component add rustfmt | ||
- uses: ./.github/actions/ci | ||
- uses: ./.github/actions/build-docs | ||
|
||
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 | ||
name: 'Get crates.io token' | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/production/common/releasing/cratesio/api_token = CARGO_REGISTRY_TOKEN' | ||
|
||
- uses: ./.github/actions/publish | ||
with: | ||
token: ${{env.CARGO_REGISTRY_TOKEN}} | ||
dry_run: ${{ inputs.dry_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Run Release Please | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-package: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # Needed if using OIDC to get release secrets. | ||
contents: write # Contents and pull-requests are for release-please to make releases. | ||
pull-requests: write | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
command: manifest | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
default-branch: main | ||
|
||
- uses: actions/checkout@v4 | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
fetch-depth: 0 # If you only need the current version keep this. | ||
|
||
- name: Setup rust tooling | ||
if: ${{ steps.release.outputs.releases_created }} | ||
run: | | ||
rustup override set 1.68 | ||
rustup component add rustfmt | ||
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 | ||
name: 'Get crates.io token' | ||
with: | ||
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/production/common/releasing/cratesio/api_token = CARGO_REGISTRY_TOKEN' | ||
|
||
- uses: ./.github/actions/ci | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- uses: ./.github/actions/build-docs | ||
if: ${{ steps.release.outputs.releases_created }} | ||
|
||
- uses: ./.github/actions/publish | ||
if: ${{ steps.release.outputs.releases_created }} | ||
with: | ||
token: ${{env.CARGO_REGISTRY_TOKEN}} | ||
dry_run: false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"eventsource-client": "0.11.0" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"plugins": ["cargo-workspace"], | ||
"release-type": "rust", | ||
"bump-minor-pre-major": true, | ||
"versioning": "default", | ||
"include-component-in-tag": false, | ||
"packages": { | ||
"eventsource-client": {} | ||
} | ||
} |