Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add publish workflow for releasing on CI automatically #207

Merged
merged 7 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "mdx-js/vscode-mdx"
}
],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/loud-weeks-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vscode-mdx": patch
---

ci: add publish workflow for releasing on CI automatically
5 changes: 5 additions & 0 deletions .changeset/selfish-birds-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vscode-mdx": major
---

build!: republish under `unifiedjs` org
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish

on:
release:
types:
- published

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Dependencies
run: yarn --frozen-lockfile

- name: ovsx publish
uses: HaaLeo/publish-vscode-extension@v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any benefits to use this action instead of the official vsce CLI?

Also: nice that this extension is also published to the Open VSX registry.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It keeps usage consistency between vsce and open-vsx, I supposed?

id: ovsx_publish
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}

- name: vsce publish
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VSCE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.ovsx_publish.outputs.vsixPath }}

- uses: actions/upload-artifact@v3
with:
name: vscode-mdx.vsix
path: ${{ steps.ovsx_publish.outputs.vsixPath }}

- name: upload vsix to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.ovsx_publish.outputs.vsixPath }}
asset_name: vscode-mdx.vsix
tag: ${{ github.ref }}
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release

on:
push:
tags:
- v*.*.*

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workspace }}/CHANGELOG.md
44 changes: 44 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Version

on:
push:
branches:
- master

jobs:
version:
name: Version
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm

- name: Install Dependencies
run: pnpm i

- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
commit: 'chore: release vscode-mdx'
title: 'chore: release vscode-mdx'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push Tags
if: steps.changesets.outputs.hasChangesets == 'false'
run: git push --follow-tags
3 changes: 2 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*.map
*.ts
*.tsbuildinfo
release.sh
tsconfig.json
tsconfig.base.json
node_modules
patches
test
yarn.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Standard Version](https://img.shields.io/badge/maintained%20with-standard%20version-cc00ff.svg)](https://github.com/conventional-changelog/standard-version)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-cc00ff.svg)](https://github.com/changesets/changesets)

Adds language support for [MDX].

Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"repository": "https://github.com/mdx-js/vscode-mdx.git",
"author": "JounQin",
"publisher": "JounQin",
"publisher": "unifiedjs",
"donate": {
"recipients": [
{
Expand Down Expand Up @@ -46,6 +46,7 @@
},
"license": "MIT",
"private": true,
"packageManager": "yarn@1.22.19",
"engines": {
"vscode": ">=1.0.0"
},
Expand All @@ -56,13 +57,13 @@
],
"scripts": {
"lint": "eslint . --cache -f friendly",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"release": "sh release.sh"
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0"
},
"devDependencies": {
"@1stg/common-config": "^5.2.6",
"@1stg/common-config": "^6.0.0",
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.23.1",
"patch-package": "^6.4.7",
"standard-version": "^9.5.0",
"typescript": "^4.7.4",
"yarn-deduplicate": "^5.0.0"
},
Expand Down
11 changes: 0 additions & 11 deletions release.sh

This file was deleted.

Loading