Skip to content

Commit

Permalink
add GitHub action to publish on crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
andreapavoni committed Oct 25, 2023
1 parent 29adb05 commit 68e3b5c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
types: [merged]

env:
CARGO_TERM_COLOR: always
Expand All @@ -21,17 +20,3 @@ jobs:
run: cargo clippy
- name: Run tests
run: cargo run --example game

release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clippy
run: cargo clippy
- name: Run tests
run: cargo run --example game
- uses: manoadamro/rust-release@v1
with:
owner: ${{ github.repository_owner }}
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: crates.io

on:
push:
tags:
- '*' # Push events to every tag not containing /
workflow_dispatch:

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}

0 comments on commit 68e3b5c

Please sign in to comment.