Skip to content

Commit 9d709f2

Browse files
authored
Rollback workflow split (#22)
1 parent d2dafed commit 9d709f2

File tree

3 files changed

+49
-79
lines changed

3 files changed

+49
-79
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,78 @@
1-
name: Create GitHub Release
1+
name: Create Release
22

33
on:
4-
workflow_run:
5-
workflows: ["Build Cornifer"]
6-
types:
7-
- completed
4+
push:
5+
6+
workflow_dispatch:
87

98
jobs:
10-
release:
11-
name: Create GitHub Release
9+
build:
10+
name: Create Build
1211
runs-on: ubuntu-latest
13-
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }}
12+
env:
13+
PUSH_PACKAGES: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
1414
steps:
15-
- name: Download Build Artifact
16-
uses: actions/download-artifact@v4
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
1719
with:
18-
name: cornifer-vsix
20+
node-version: 18.x
21+
22+
- name: npm ci
23+
run: |
24+
npm ci
25+
26+
- name: npm test [Linux]
27+
run: |
28+
xvfb-run -a npm test
29+
if: runner.os == 'Linux'
30+
- name: npm test [!Linux]
31+
run: |
32+
npm test
33+
if: runner.os != 'Linux'
1934

20-
- name: Get version from package.json
35+
- name: Package vsix
36+
run: |
37+
npm run craft
38+
39+
# Release
40+
- name: Get version from package.json and set in Env
41+
if: ${{ env.PUSH_PACKAGES == 'true' }}
2142
run: |
2243
sudo apt install jq
2344
echo "CORNIFER_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
2445
2546
- name: Create Release
47+
if: ${{ env.PUSH_PACKAGES == 'true' }}
2648
id: create_release
2749
uses: actions/create-release@v1
2850
env:
2951
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3052
with:
3153
tag_name: v${{ env.CORNIFER_VERSION }}
32-
release_name: ${{ env.CORNIFER_VERSION }}
54+
release_name: ${{ env.CORNIFER_VERSION }}
3355
body: |
34-
Please check `CHANGELOG.md` for latest fixes and updates.
56+
Please check `CHANGELOG.md` for latest fixes and updates.
3557
draft: false
3658
prerelease: false
3759

38-
- name: Upload Release Asset
60+
- name: Upload Cornifer Artifact
61+
if: ${{ env.PUSH_PACKAGES == 'true' }}
3962
uses: actions/upload-release-asset@v1
4063
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
GITHUB_TOKEN: ${{ github.token }}
4265
with:
4366
upload_url: ${{ steps.create_release.outputs.upload_url }}
4467
asset_path: cornifer-${{ env.CORNIFER_VERSION }}.vsix
4568
asset_name: cornifer-${{ env.CORNIFER_VERSION }}.vsix
46-
asset_content_type: application
69+
asset_content_type: application
70+
71+
# Marketplace
72+
- name: Publish to marketplace
73+
if: ${{ env.PUSH_PACKAGES == 'true' }}
74+
uses: lannonbr/[email protected]
75+
with:
76+
args: "publish -p $VSCE_TOKEN"
77+
env:
78+
VSCE_TOKEN: ${{ secrets.MARKETPLACE_PAT }}

0 commit comments

Comments
 (0)