Skip to content

Added a default value for VersionSpecifier and some documentation (… #322

Added a default value for VersionSpecifier and some documentation (…

Added a default value for VersionSpecifier and some documentation (… #322

Workflow file for this run

name: "publish"
on:
# Run using manual triggers from GitHub UI:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch: {}
# Run on pushes to 'main' branch':
push:
branches:
- "main"
# Wait for any other publish workflows in-progress to complete, before starting a new one:
concurrency:
group: "${{ github.workflow }}"
cancel-in-progress: false
jobs:
publish:
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync)
# Only run on the main repo (not forks), and only on the 'main' branch:
if: "${{ github.repository == 'NomicFoundation/slang' && github.ref_name == 'main' }}"
permissions:
contents: "write" # to create new branches and releases
id-token: "write" # OIDC token (needed for trusted publishing)
pull-requests: "write" # to create new pull requests for changesets
steps:
- name: "Checkout Repository"
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
- name: "Restore Cache"
uses: "./.github/actions/cache/restore"
- name: "infra setup"
run: "./scripts/bin/infra setup"
# Consume the changesets, and create a git stash, to be popped by the next step:
- name: "infra publish changesets"
run: "./scripts/bin/infra publish changesets"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "Create/Update Changesets Pull Request"
id: "runChangesets"
uses: "changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba"
with:
title: "Bump Slang Version"
commit: "Bump Slang Version"
createGithubReleases: false
version: "git stash pop" # Stash created by 'infra publish changesets'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "infra publish mkdocs --target main-branch"
run: "./scripts/bin/infra publish mkdocs --target main-branch"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "infra publish mkdocs --target latest-release"
if: "${{ steps.runChangesets.outputs.hasChangesets == 'false' }}"
run: "./scripts/bin/infra publish mkdocs --target latest-release"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "infra publish npm"
if: "${{ steps.runChangesets.outputs.hasChangesets == 'false' }}"
run: "./scripts/bin/infra publish npm"
- name: "Exchange Cargo Token"
id: "exchangeCargoToken"
uses: "rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec"
- name: "infra publish cargo"
if: "${{ steps.runChangesets.outputs.hasChangesets == 'false' }}"
run: "./scripts/bin/infra publish cargo"
env:
CARGO_REGISTRY_TOKEN: "${{ steps.exchangeCargoToken.outputs.token }}"
- name: "infra publish github-release"
if: "${{ steps.runChangesets.outputs.hasChangesets == 'false' }}"
run: "./scripts/bin/infra publish github-release"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"