use manual workflow dispatch to publish artifacts #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish All | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| jobs: | ||
| ci: | ||
| name: Runs CI | ||
| uses: ./.github/workflows/ci.yml | ||
| secrets: inherit | ||
| with: | ||
| publish: true | ||
| tag-release: | ||
| name: Tag Release | ||
| needs: publish | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: jrobsonchase/direnv-action@v0.7 | ||
| - name: Tag Release | ||
| run: | | ||
| version="$(grep '^version =' Cargo.toml | head -n1 | awk -F\" '{print $2}')" | ||
| tag="v${version}" | ||
| git config user.name "GitHub Action" | ||
| git config user.email noreply@ngrok.com | ||
| echo "Version: ${version} tag: $tag" | ||
| echo "Fetching all tags in the repository" | ||
| git fetch --tags | ||
| if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then | ||
| echo "Tag $tag already exists, skipping tag creation." | ||
| else | ||
| echo "Tag $tag does not exist, pushing tag." | ||
| git tag -a -m "Version ${version}" $tag | ||
| git push --tags | ||
| fi | ||