Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Publish extension auto #1

Publish extension auto

Publish extension auto #1

name: Publish extension auto
on:
workflow_call:
inputs:
workspace:
required: true
type: string
description: |
The yarn workspace the extension is in.
pre-release:
required: false
type: boolean
description: |
Whether this is a pre-release.
compute-version:
required: false
type: boolean
description: |
Whether to compute a new version if the version already exists o the marketplace.
secrets:
CARGO_REGISTRY_TOKEN:
required: true
VSCE_PAT:
required: true
workflow_dispatch:
inputs:
workspace:
required: true
type: string
description: |
The yarn workspace the extension is in.
pre-release:
required: false
type: boolean
description: |
Whether this is a pre-release.
compute-version:
required: false
type: boolean
description: |
Whether to compute a new version if the version already exists o the marketplace.
jobs:
compute-version:
uses: ./.github/workflows/compute-version.yml
with:
workspace: ${{ inputs.workspace }}
compute-version: ${{ inputs.compute-version }}
publish:
needs:
- compute-version
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: windows-latest
target: i686-pc-windows-msvc
code-target: win32-ia32
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
#container: ubuntu:18.04
#- os: ubuntu-20.04
# target: aarch64-unknown-linux-gnu
# code-target: linux-arm64
#- os: ubuntu-20.04
# target: arm-unknown-linux-gnueabihf
# code-target: linux-armhf
- os: macos-11
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-11
target: aarch64-apple-darwin
code-target: darwin-arm64
uses: ./.github/workflows/publish-targeted-extension.yml
with:
workspace: ${{ inputs.workspace }}
os: ${{ matrix.os }}
target: ${{ matrix.target }}
code-target: ${{ matrix.code-target }}
version: ${{ needs.compute-version.outputs.version }}
pre-release: ${{ inputs.pre-release }}
secrets:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
commit-and-tag:
needs:
- compute-version
- publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get tag prefix
id: get-tag-prefix
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const workspace = '${{ inputs.workspace }}';
const language = workspace.split('-')[1];
return language;
- name: Setup git config
run: |
git config --local user.email "[email protected]"
git config --local user.name "Astrodevs CI"
- name: tag
run: |
git tag -a "${{steps.get-tag-prefix.outputs.result}}-${{ needs.compute-version.outputs.version }}" -m "Release ${{ steps.get-tag-prefix.outputs.result }}-${{ needs.compute-version.outputs.version }}"
git push origin "${{steps.get-tag-prefix.outputs.result}}-${{ needs.compute-version.outputs.version }}"