-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from longkai/v2
Release the brand new v2 version 🎉
- Loading branch information
Showing
13 changed files
with
4,162 additions
and
3,371 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,40 @@ | ||
name: release to visual studio code extension marketplace | ||
name: Release to Visual Studio Code Extension Marketplace | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
name: build yamlfmt binary | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout forked yamlfmt repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
repository: longkai/yamlfmt | ||
ref: vscode | ||
- name: setup golang | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '>=1.19' | ||
check-latest: true | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v3 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: --snapshot --rm-dist | ||
- name: rm tar.gz | ||
run: rm -rf *.tar.gz | ||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binaries | ||
path: "dist/yamlfmt_*" | ||
|
||
package: | ||
name: package vscode extension | ||
name: Package VS Code Extension and Publish to the Marketplace | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: binaries | ||
path: /tmp | ||
- name: checkout extension repo | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.ref }} | ||
- name: Set up Git configuration | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.event.pusher.email }}" | ||
- name: setup nodejs | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
node-version: 22 | ||
- name: npm install | ||
run: npm install | ||
- name: package multi-platforms | ||
shell: bash | ||
- name: Publish Pre-release to the Marketplace | ||
run: | | ||
declare -A map | ||
map["win32-x64"]=windows_amd64_v1 | ||
map["win32-arm64"]=windows_arm64 | ||
map["linux-x64"]=linux_amd64_v1 | ||
map["linux-arm64"]=linux_arm64 | ||
map["darwin-x64"]=darwin_amd64_v1 | ||
map["darwin-arm64"]=darwin_arm64 | ||
for arch in ${!map[*]}; do | ||
rm -rf bin/ | ||
mv "/tmp/yamlfmt_${map[$arch]}" bin/ | ||
chmod +x -R bin/ | ||
npx vsce package --target $arch | ||
done | ||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: "*.vsix" | ||
|
||
release: | ||
name: publish vscode extension to marketplace | ||
runs-on: ubuntu-latest | ||
needs: package | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
- run: npx vsce publish --packagePath $(find . -iname '*.vsix') | ||
npx vsce publish ${{ github.ref_name }} --pre-release | ||
if: "github.event.release.prerelease" | ||
env: | ||
VSCE_PAT: ${{ secrets.VSCE_PAT }} | ||
- name: Publish to the Marketplace | ||
run: | | ||
npx vsce publish ${{ github.ref_name }} | ||
if: "!github.event.release.prerelease" | ||
env: | ||
VSCE_PAT: ${{ secrets.VSCE_PAT }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,4 +131,5 @@ dist | |
|
||
.vscode/ | ||
|
||
bin/ | ||
bin/ | ||
.vsix |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const { defineConfig } = require('@vscode/test-cli'); | ||
|
||
module.exports = defineConfig({ files: 'out/test/**/*.test.js' }); |
This file contains 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
This file contains 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
Oops, something went wrong.