forked from NomicFoundation/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (80 loc) · 2.87 KB
/
_jobs_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
94
95
96
97
98
99
100
name: "jobs/publish"
on:
# Run when invoked from other workflows:
workflow_call: {}
jobs:
changesets:
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync)
permissions:
contents: "write" # to create new branches and releases
pull-requests: "write" # to create new pull requests for changesets
steps:
#
# _DEVCONTAINER_PREPARATION_STEPS_ (keep in sync)
# Cache is updated in the "ci" workflow, then reused here.
#
- name: "Clone repository"
uses: "actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633"
- name: "Restore CI cache"
uses: "actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9"
with:
key: "cache-${{ github.ref_name }}-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('package-lock.json') }}"
restore-keys: |
cache-${{ github.ref_name }}-
cache-main-
cache-
path: |
~/.cache/hermit/
~/.local/share/virtualenvs/
.hermit/
#
# Publish Changesets:
#
- run: "scripts/bin/infra setup npm"
- id: "changesets"
uses: "changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9"
with:
title: "Bump Slang Version"
commit: "Bump Slang Version"
createGithubReleases: false
version: "scripts/bin/infra publish changesets"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
outputs:
hasChangesets: "${{ steps.changesets.outputs.hasChangesets }}"
assets:
needs: "changesets"
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync)
if: "${{ needs.changesets.outputs.hasChangesets == 'false' }}"
steps:
#
# _DEVCONTAINER_PREPARATION_STEPS_ (keep in sync)
# Cache is updated in the "ci" workflow, then reused here.
#
- name: "Clone repository"
uses: "actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633"
- name: "Restore CI cache"
uses: "actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9"
with:
key: "cache-${{ github.ref_name }}-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('package-lock.json') }}"
restore-keys: |
cache-${{ github.ref_name }}-
cache-main-
cache-
path: |
~/.cache/hermit/
~/.local/share/virtualenvs/
.hermit/
#
# Build and Publish:
#
- run: "scripts/bin/infra setup cargo npm"
- run: "scripts/bin/infra publish npm"
env:
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
- run: "scripts/bin/infra publish cargo"
env:
CARGO_REGISTRY_TOKEN: "${{ secrets.CARGO_REGISTRY_TOKEN }}"
- run: "scripts/bin/infra publish github-release"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"