Skip to content

Commit

Permalink
Publish through CI using GIT tags (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja authored Mar 15, 2024
1 parent ba05f08 commit 834b4c7
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* text=auto

# Don't compute diff for these files
Cargo.lock -diff
dist/** -diff

# Don't export/archive these files
.github export-ignore
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,57 @@ jobs:
run: |
cd examples/${{ matrix.example }}
cargo leptos build --release
test-release-leptos-hotkeys:
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
name: Test leptos-hotkeys release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: hecrj/setup-rust-action@v2
- name: Publish
run: |
cargo login ${{ secrets.CRATES_TOKEN }}
cargo publish -v -p leptos-hotkeys
release-leptos-hotkeys:
if: startsWith(github.ref, 'refs/tags/')
name: Release leptos-hotkeys
needs:
- lint
- build-example
- test-release-leptos-hotkeys
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: hecrj/setup-rust-action@v2
- name: Publish
run: |
cargo login ${{ secrets.CRATES_TOKEN }}
cargo publish -v -p leptos-fluent-macros
create-release:
if: startsWith(github.ref, 'refs/tags/')
name: Create release
needs: release-leptos-hotkeys
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get tag metadata
id: tag
run: |
TAG_TITLE=${GITHUB_REF#refs/*/}
echo "title=$TAG_TITLE" >> $GITHUB_OUTPUT
- name: Create release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ steps.tag.outputs.title }}
tag_name: ${{ steps.tag.outputs.title }}
body: |
See [CHANGELOG](https://github.com/gaucho-labs/leptos-hotkeys/blob/main/CHANGELOG.md).
draft: false
prerelease: false
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ cargo make lint
```sh
cargo make format
```

## Release

1. Update *CHANGELOG.md* and bump version.
1. Push the changes to the main branch.
1. Create a and push GIT tag from latest main branch:

```sh
git tag -a v0.1.0 -m ""
git push origin v0.1.0
```

> [!NOTE] Change `v0.1.0` to the new version number.

0 comments on commit 834b4c7

Please sign in to comment.