forked from NomicFoundation/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (78 loc) · 3.27 KB
/
publish.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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
pull-requests: "write" # to create new pull requests for changesets
steps:
- name: "Checkout Repository"
uses: "actions/checkout@d632683dd7b4114ad314bca15554477dd762a938"
- name: "Restore Cache"
uses: "./.github/actions/cache/restore"
- name: "infra publish changesets"
uses: "./.github/actions/devcontainer/run"
with:
runCmd: "./scripts/bin/infra publish changesets"
env: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
- name: "Create/Update Changesets Pull Request"
id: "runChangesets"
uses: "changesets/action@3de3850952bec538fde60aac71731376e57b9b57"
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"
uses: "./.github/actions/devcontainer/run"
with:
runCmd: "./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' }}"
uses: "./.github/actions/devcontainer/run"
with:
runCmd: "./scripts/bin/infra publish mkdocs --target latest-release"
env: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
- name: "infra publish npm"
if: "${{ steps.runChangesets.outputs.hasChangesets == 'false' }}"
uses: "./.github/actions/devcontainer/run"
with:
runCmd: "./scripts/bin/infra publish npm"
env: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
# __SLANG_CARGO_PUBLISH_TEMPORARILY_DISABLED__ (keep in sync)
#
# - name: "infra publish cargo"
# if: "${{ steps.runChangesets.outputs.hasChangesets == 'false' }}"
# uses: "./.github/actions/devcontainer/run"
# with:
# runCmd: "./scripts/bin/infra publish cargo"
# env: |
# CARGO_REGISTRY_TOKEN=${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: "infra publish github-release"
if: "${{ steps.runChangesets.outputs.hasChangesets == 'false' }}"
uses: "./.github/actions/devcontainer/run"
with:
runCmd: "./scripts/bin/infra publish github-release"
env: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}