Repository navigation
62 lines (57 loc) · 2.47 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (57 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Release
# A release: CI on the commit (which builds the backend's ok-image bundle, its universal package with
# every system's okrun, and both editor packages carrying the bundle), then a GitHub release with the
# editor packages, the bundle, the universal package and their checksums. The two Marketplaces are
# uploaded to by the maintainer, from those assets.
on:
workflow_dispatch:
push:
tags: ['v*']
permissions:
contents: write
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
needs: ci
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
with:
path: artifacts
- name: Release
env:
GH_TOKEN: ${{ github.token }}
run: |
version="$(sed -n 's/^version *= *"\(.*\)"/\1/p' mcpp.toml | head -1)"
mkdir -p dist
cp artifacts/mcpp-vscode-vsix/*.vsix artifacts/mcpp-clion-zip/*.zip dist/
cp artifacts/backend/mcpp-ide.okb "dist/mcpp-ide-${version}.okb"
cp "artifacts/backend/mcpp-ide-${version}"-openkal*.tar.gz dist/
(cd dist && sha256sum * > SHA256SUMS && cat SHA256SUMS)
gh release create "v${version}" dist/* --target "$GITHUB_SHA" --title "mcpp-ide ${version}" --notes-file CHANGELOG.md
# Open VSX receives the exact VSIX attached to the GitHub Release; the Visual Studio
# Marketplace and the JetBrains Marketplace receive the same assets through their portals.
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Publish to Open VSX
env:
OPENVSX_TOKEN: ${{ secrets.OPENVSX_TOKEN }}
run: |
set -euo pipefail
if [ -z "${OPENVSX_TOKEN:-}" ]; then
echo "OPENVSX_TOKEN is not set: Open VSX is a required destination of a release."
echo "Create a token with the publish scope at open-vsx.org (Settings, Access Tokens) and add it"
echo "as the OPENVSX_TOKEN secret of this repository (Settings, Secrets and variables, Actions)."
exit 1
fi
(cd mide-plugins/vscode && npm ci --ignore-scripts)
vsix="$(ls dist/mcpp-vscode-*.vsix)"
(cd mide-plugins/vscode && npx ovsx publish "$GITHUB_WORKSPACE/$vsix" --pat "$OPENVSX_TOKEN")
- name: The Marketplaces
run: echo "Upload the GitHub Release VSIX manually to Visual Studio Marketplace, and the CLion zip to JetBrains Marketplace."