diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml new file mode 100644 index 0000000..9516333 --- /dev/null +++ b/.github/workflows/release-pr.yml @@ -0,0 +1,38 @@ +name: Open a Rust release PR +on: + workflow_dispatch: + inputs: + version: + description: Version to release + required: true + type: string + +jobs: + make-release-pr: + permissions: + id-token: write + pull-requests: write + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: chainguard-dev/actions/setup-gitsign@main + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + + - name: Install cargo-release + run: | + VERSION=$(curl --silent "https://api.github.com/repos/crate-ci/cargo-release/releases/latest" | jq -r .tag_name) + wget https://github.com/crate-ci/cargo-release/releases/download/$VERSION/cargo-release-$VERSION-x86_64-unknown-linux-gnu.tar.gz + tar -xzvf cargo-release-$VERSION-x86_64-unknown-linux-gnu.tar.gz --wildcards '*cargo-release' --strip-components=1 + cp cargo-release $HOME/.cargo/bin + + - uses: cargo-bins/release-pr@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ inputs.version }} + crate-name: light-poseidon diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..00a4cee --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + tags: + - "*" + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + run: | + cargo publish -p light-poseidon --token $CARGO_REGISTRY_TOKEN