diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index d1a5ca3..7631666 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -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 }} diff --git a/Earthfile b/Earthfile index 8ab9e09..6ae72dc 100644 --- a/Earthfile +++ b/Earthfile @@ -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 diff --git a/ci/publish.sh b/ci/publish.sh new file mode 100755 index 0000000..4dd61c3 --- /dev/null +++ b/ci/publish.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +set -o errexit +set -o xtrace + +cargo publish --verbose