name: Package Publish
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Get tag version
id: get_tag_version
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
- name: Checkout plugins repo
uses: actions/checkout@v2
with:
repository: dprint/plugins
token: ${{ secrets.CI_REPO_PAT }} path: dprint-plugins
- name: Plugin publish
run: |
cd dprint-plugins
curl -L https://github.com/dprint/dprint-plugin-typescript/releases/download/${{ steps.get_tag_version.outputs.TAG_VERSION }}/typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}.wasm \
--output typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}.wasm
node scripts/replace-plugin.js dprint-plugin-typescript ${{ steps.get_tag_version.outputs.TAG_VERSION }} typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}
git add .
git config user.name "David Sherret"
git config user.email "dsherret@users.noreply.github.com"
git commit -m "dprint-plugin-typescript ${{ steps.get_tag_version.outputs.TAG_VERSION }}"
git push origin master
- name: Checkout
uses: actions/checkout@v2
- name: Cache cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo login
run: cargo login ${{ secrets.CRATES_TOKEN }}
- name: Cargo publish
run: cargo publish