Skip to content

Commit

Permalink
Merge pull request #10 from moia-oss/add-release-pipeline
Browse files Browse the repository at this point in the history
Add release pipeline
  • Loading branch information
Felerius authored Feb 14, 2023
2 parents 86137c2 + 2e0155a commit 450ec68
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish

on:
push:
branches:
- main

jobs:
release-on-push:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Calculate next version
id: calc-version
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: norelease
tag_prefix: ""
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set version
run: |
sed -i "s/^version = \".*\"$/version = \"${{ steps.calc-version.outputs.version }}\"/" Cargo.toml
- name: Publish new version to main
run: |
git config --global user.email "[email protected]"
git config --global user.name "MOIA Rust Maintainers"
git commit -am "Release ${{ steps.calc-version.outputs.version }}"
git push
- name: Create github release
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: norelease
tag_prefix: ""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 450ec68

Please sign in to comment.