Skip to content

Commit

Permalink
chore: simplify and automate publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jun 30, 2023
1 parent a4ffd16 commit 56645de
Showing 1 changed file with 5 additions and 91 deletions.
96 changes: 5 additions & 91 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
name: publish

on:
workflow_dispatch:
inputs:
tag:
description: The tag to publish
required: true
type:
description: What type of release is this?
required: true
type: choice
default: release
options:
- release
- prerelease
release:
types: [published]

jobs:
github-release:
if: ${{ github.event.inputs.type == 'release' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}

- name: 🏗 Setup project
uses: ./.github/actions/setup-project
Expand All @@ -39,42 +25,13 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: vscode-expo-*.vsix
tag_name: ${{ github.event.inputs.tag }}
tag_name: ${{ github.ref_name }}

github-prerelease:
if: ${{ github.event.inputs.type == 'prerelease' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}

- name: 🏗 Setup project
uses: ./.github/actions/setup-project

- name: 🎁 Package extension
run: yarn vsce package --pre-release --yarn
env:
VSCODE_EXPO_TELEMETRY_KEY: ${{ secrets.TELEMETRY_KEY }}

- name: 📋 Add package to release
uses: softprops/action-gh-release@v1
with:
files: vscode-expo-*.vsix
tag_name: ${{ github.event.inputs.tag }}
prerelease: true

vscode-marketplace-release:
if: ${{ github.event.inputs.type == 'release' }}
vscode-marketplace:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo from tag
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}

- name: 🏗 Setup project
uses: ./.github/actions/setup-project
Expand All @@ -85,32 +42,11 @@ jobs:
VSCODE_EXPO_TELEMETRY_KEY: ${{ secrets.TELEMETRY_KEY }}
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}

vscode-marketplace-prerelease:
if: ${{ github.event.inputs.type == 'prerelease' }}
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo from tag
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}

- name: 🏗 Setup project
uses: ./.github/actions/setup-project

- name: 🚀 Publish to marketplace
run: yarn vsce publish --pre-release --yarn
env:
VSCODE_EXPO_TELEMETRY_KEY: ${{ secrets.TELEMETRY_KEY }}
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}

open-vsx-release:
if: ${{ github.event.inputs.type == 'release' }}
open-vsx:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo from tag
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}

- name: 🏗 Setup project
uses: ./.github/actions/setup-project
Expand All @@ -124,25 +60,3 @@ jobs:
run: npx ovsx publish ./vscode-expo.vsix
env:
OVSX_PAT: ${{ secrets.OPENVSX_TOKEN }}

open-vsx-prerelease:
if: ${{ github.event.inputs.type == 'prerelease' }}
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo from tag
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}

- name: 🏗 Setup project
uses: ./.github/actions/setup-project

- name: 🎁 Package extension
run: yarn vsce package --pre-release --yarn --out ./vscode-expo.vsix
env:
VSCODE_EXPO_TELEMETRY_KEY: ${{ secrets.TELEMETRY_KEY }}

- name: 🚀 Publish to open-vsx
run: yarn ovsx publish --pre-release ./vscode-expo.vsix
env:
OVSX_PAT: ${{ secrets.OPENVSX_TOKEN }}

0 comments on commit 56645de

Please sign in to comment.