Skip to content

Commit

Permalink
ci: support publishing via release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Aug 7, 2022
1 parent e4873a6 commit cac7f81
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ on:
description: The release TAG to publish. i.e. `v2.3.0`
required: true
default: "v2.3.0"
workflow_call:
inputs:
ref:
type: string
required: true
secrets:
OVSX_TOKEN:
required: true
VSCE_TOKEN:
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
35 changes: 28 additions & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}

steps:
- uses: google-github-actions/release-please-action@v3
id: release
Expand All @@ -25,14 +28,32 @@ jobs:
RESULTS: ${{ toJSON(steps.release.outputs) }}
run: echo "$RESULTS"

publish:
- name: tag versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/streetsidesoftware/vscode-spell-checker.git"
git tag -a v${{ steps.release.outputs.version }} -m "Release v${{ steps.release.outputs.version }}"
git push origin v${{ steps.release.outputs.version }}
result:
runs-on: ubuntu-latest
needs:
- release-please
if: ${{ needs.release-please.outputs.release_created }}
env:
OUTPUTS: ${{ toJSON(needs.release-please.outputs) }}
steps:
- run: echo "Publish"
# uses: ./.github/workflows/publish.yml
# secrets:
# PUBLISH_NPM: ${{ secrets.PUBLISH_NPM }}
# cspell:ignore noreply
- run: echo "Result"
- run: echo "$OUTPUTS"

publish:
needs:
- release-please
if: ${{ needs.release-please.outputs.release_created }}
uses: ./.github/workflows/manual-publish.yml
with:
ref: ${{ needs.release-please.outputs.tag_name }}
secrets:
OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }}
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
2 changes: 2 additions & 0 deletions cspell-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ mobx
multiroot
myvariable
nohoist
noreply
nospace
onfinally
overridable
OVSX
paginator
permalinks
Preformat
Expand Down

0 comments on commit cac7f81

Please sign in to comment.