Skip to content

Merge pull request #504 from tensor-programming/feat/expose_runner #217

Merge pull request #504 from tensor-programming/feat/expose_runner

Merge pull request #504 from tensor-programming/feat/expose_runner #217

# This runs every time a commit is pushed to the `dev` branch.
# It will dynamically choose to run `covector version` or `covector publish`.
# If there are change files present it will run `version`, otherwise it will run `publish`.
# When it runs `publish`, it will use the `./.changes/config.json` packages configuration,
# and run the `getPublishedVersion`. If that returns a value that matches the current version number,
# then it will skip the attempting to publish.
name: publish
on:
push:
branches:
- dev
- 2.0
workflow_dispatch:
jobs:
version-or-publish:
runs-on: ubuntu-latest
timeout-minutes: 65
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: cargo login
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/action@covector-v0
id: covector
env:
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: "version-or-publish"
createRelease: true
- name: Create Pull Request With Versions Bumped
if: steps.covector.outputs.commandRan == 'version'
uses: tauri-apps/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates
title: Apply Version Updates From Current Changes
commit-message: "apply version updates"
labels: "version updates"
body: ${{ steps.covector.outputs.change }}