Skip to content

Commit

Permalink
ci: Add Github Actions jobs for release management (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadorovsky committed Oct 29, 2023
1 parent 7e33fd8 commit 8616d81
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8616d81

Please sign in to comment.