Skip to content

Commit 053accf

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/http-cache-semantics-4.1.1
2 parents 1727735 + fe25433 commit 053accf

File tree

25 files changed

+531
-2510
lines changed

25 files changed

+531
-2510
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @github/c2c-actions-experience-parser-reviewers
1+
* @actions/actions-workflow-development-reviewers

.github/workflows/publish-npm.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Create release PR
2+
3+
run-name: Create release PR for v${{ github.event.inputs.version }}
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
required: true
10+
description: "Version to bump `package.json` to (format: x.y.z)"
11+
12+
jobs:
13+
create-release-pr:
14+
name: Create release PR
15+
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: "16"
28+
29+
- name: Bump version and push
30+
run: |
31+
git config --global user.email "github-actions@github.com"
32+
git config --global user.name "GitHub Actions"
33+
34+
git checkout -b release/${{ inputs.version }}
35+
36+
npx lerna version ${{ inputs.version }} --yes --no-push --no-git-tag-version --force-publish
37+
38+
git add **/package.json package-lock.json lerna.json
39+
git commit -m "Release extension version ${{ inputs.version }}"
40+
41+
git push --set-upstream origin release/${{ inputs.version }}
42+
43+
- name: Create PR
44+
run: |
45+
gh pr create \
46+
--title "Release version ${{ inputs.version }}" \
47+
--body "Release version ${{ inputs.version }}" \
48+
--base main \
49+
--head release/${{ inputs.version }}
50+
env:
51+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Release and publish packages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- lerna.json
9+
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: "Version to release"
14+
required: true
15+
16+
jobs:
17+
check-version-change:
18+
outputs:
19+
changed: ${{ steps.check-version.outputs.result }}
20+
21+
runs-on: ubuntu-latest
22+
23+
permissions:
24+
contents: read
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
- name: Check if version has changed
29+
id: check-version
30+
uses: actions/github-script@v6
31+
with:
32+
script: |
33+
const version = '${{ inputs.version }}' || require('./lerna.json').version;
34+
// Find a release for that version
35+
const release = await github.rest.repos.getReleaseByTag({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
tag: `release-v${version}`,
39+
}).catch(() => null);
40+
41+
// If the release exists, the version has not changed
42+
if (release) {
43+
console.log(`Version ${version} has an existing release`);
44+
console.log(release.data.html_url);
45+
core.summary.addLink(`Release v${version}`, release.data.html_url);
46+
await core.summary.write();
47+
return "false";
48+
}
49+
console.log(`Version ${version} does not have a release`);
50+
return true;
51+
52+
release:
53+
environment: publish
54+
55+
needs: check-version-change
56+
if: ${{ needs.check-version-change.outputs.changed == 'true' }}
57+
58+
runs-on: ubuntu-latest
59+
60+
permissions:
61+
contents: write
62+
packages: write
63+
64+
env:
65+
PKG_VERSION: "" # will be set in the workflow
66+
67+
steps:
68+
- uses: actions/checkout@v3
69+
70+
- uses: actions/setup-node@v3
71+
with:
72+
node-version: 16.x
73+
cache: "npm"
74+
scope: '@actions'
75+
76+
- name: Parse version from lerna.json
77+
run: |
78+
echo "PKG_VERSION=$(node -p -e "require('./lerna.json').version")" >> $GITHUB_ENV
79+
80+
- run: npm ci
81+
82+
- name: Create release
83+
uses: actions/github-script@v6
84+
with:
85+
script: |
86+
const fs = require("fs");
87+
88+
const release = await github.rest.repos.createRelease({
89+
owner: context.repo.owner,
90+
repo: context.repo.repo,
91+
tag_name: "release-v${{ env.PKG_VERSION }}",
92+
name: "v${{ env.PKG_VERSION }}",
93+
draft: false,
94+
prerelease: false
95+
});
96+
97+
core.summary.addLink(`Release v${{ env.PKG_VERSION }}`, release.data.html_url);
98+
await core.summary.write();
99+
100+
- name: setup authentication
101+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
102+
env:
103+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
104+
105+
- name: Publish packages
106+
run: |
107+
lerna publish ${{ env.PKG_VERSION }} --yes --no-git-reset --no-git-tag-version
108+
env:
109+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

browser-playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "browser-playground",
3-
"version": "0.1.182",
3+
"version": "0.2.0",
44
"description": "",
55
"private": true,
66
"main": "index.js",
77
"type": "module",
88
"dependencies": {
9-
"@actions/languageserver": "*",
9+
"@actions/languageserver": "^0.2.0",
1010
"monaco-editor-webpack-plugin": "^7.0.1",
1111
"monaco-editor-workers": "^0.34.2",
1212
"monaco-languageclient": "^4.0.3",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import "@github/actions-languageserver";
1+
import "@actions/languageserver";

expressions/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "@actions/expressions",
3-
"version": "0.1.182",
3+
"version": "0.3.1",
44
"license": "MIT",
55
"type": "module",
66
"source": "./src/index.ts",
7+
"publishConfig": {
8+
"access": "public"
9+
},
710
"exports": {
811
".": {
912
"import": "./dist/index.js"

expressions/src/evaluator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class Evaluator implements ExprVisitor<data.ExpressionData> {
3232
return this.eval(this.n);
3333
}
3434

35-
private eval(n: Expr): data.ExpressionData {
35+
protected eval(n: Expr): data.ExpressionData {
3636
return n.accept(this);
3737
}
3838

languageserver/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"name": "@actions/languageserver",
3-
"version": "0.1.182",
3+
"version": "0.3.1",
44
"description": "Language server for GitHub Actions",
55
"license": "MIT",
66
"type": "module",
77
"source": "./src/index.ts",
8+
"publishConfig": {
9+
"access": "public"
10+
},
811
"exports": {
912
".": {
1013
"import": "./dist/index.js"
@@ -40,8 +43,8 @@
4043
"watch": "tsc --build tsconfig.build.json --watch"
4144
},
4245
"dependencies": {
43-
"@actions/languageservice": "*",
44-
"@actions/workflow-parser": "*",
46+
"@actions/languageservice": "^0.3.1",
47+
"@actions/workflow-parser": "^0.3.1",
4548
"@octokit/rest": "^19.0.7",
4649
"@octokit/types": "^9.0.0",
4750
"vscode-languageserver": "^8.0.2",

0 commit comments

Comments
 (0)