Skip to content

Commit

Permalink
ci: adding publishing to crates.io (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperC286 authored Oct 19, 2024
1 parent 020bf9e commit 32dd91a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ jobs:
run: earthly --ci --secret GH_TOKEN +release-artifacts --release "${GITHUB_REF_NAME}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by GitHub Actions.
publish:
name: Publish.
runs-on: ubuntu-latest
steps:
- name: Download Earthly v0.8.12.
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.12/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Checkout code.
uses: actions/checkout@v4
- name: Publish.
run: earthly --ci --secret CARGO_REGISTRY_TOKEN +publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
7 changes: 7 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,10 @@ release-artifacts:
DO +COPY_SOURCECODE
ARG release
RUN --secret GH_TOKEN ./ci/release-artifacts.sh --release "${release}"


publish:
FROM +rust-base
COPY "README.md" "./"
DO +COPY_SOURCECODE
RUN --secret CARGO_REGISTRY_TOKEN ./ci/publish.sh
6 changes: 6 additions & 0 deletions ci/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

set -o errexit
set -o xtrace

cargo publish --verbose

0 comments on commit 32dd91a

Please sign in to comment.