7 Commits
1.6.2 ... 1.7.0

Author SHA1 Message Date
github-actions[bot]
959ba21b72 Updating lists 2022-01-18 15:14:29 +00:00
Shivam Mathur
5f06df1e0f Happy new year [skip ci] 2022-01-02 08:52:17 +00:00
Shivam Mathur
0d8f2cf62b Refactor workflows 2021-12-17 18:27:03 +05:30
Shivam Mathur
03f7f56b30 Bump Node version to 16.x 2021-12-17 18:27:03 +05:30
Shivam Mathur
79c4acf033 Add npm release workflow 2021-12-17 18:27:02 +05:30
Shivam Mathur
a173299cf0 Bump version to 1.7.0 2021-12-17 18:26:20 +05:30
Shivam Mathur
b0f769600b Add repo, workflow and job in cache key
Reset cache date
2021-12-17 09:53:59 +00:00
11 changed files with 1898 additions and 2560 deletions

View File

@@ -1,4 +1,4 @@
name: Release workflow
name: Git release workflow
on:
workflow_dispatch:
schedule:

69
.github/workflows/node-release.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Node release workflow
on:
release:
types: [created]
workflow_dispatch:
inputs:
skip:
description: Skip release to repository
required: false
tag:
description: Tag name
required: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
allowed-endpoints:
github.com:443
npm.pkg.github.com:443
registry.npmjs.org:443
- name: Checkout release
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v2
- name: Checkout tag
uses: actions/checkout@v2
if: github.event_name == 'workflow_dispatch'
with:
ref: ${{ github.event.inputs.tag }}
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: https://registry.npmjs.org
- name: Install dependencies and add lib
run: |
npm install
npm run build
sed -i -e '/lib\//d' .gitignore
- name: Publish to NPM
if: "!contains(github.event.inputs.skip, 'skip-npm')"
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Change to GitHub Packages registry
uses: actions/setup-node@v2
with:
registry-url: https://npm.pkg.github.com
scope: '@shivammathur'
- name: Patch package.json
run: |
sed -i 's#"name": "#"name": "@shivammathur/#' package.json
- name: Publish to GitHub Packages
if: "!contains(github.event.inputs.skip, 'skip-github-packages')"
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,4 +1,4 @@
name: Main workflow
name: Node test workflow
on: [push, pull_request]
jobs:
run:
@@ -8,10 +8,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js 12.x
uses: actions/setup-node@v1
- name: Setup Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
- name: Install dependencies
run: npm install

View File

@@ -1,7 +1,7 @@
The MIT License (MIT)
Copyright (c) 2020 shivammathur and contributors
Copyright (c) 2020-2022 shivammathur and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -15,5 +15,5 @@ inputs:
description: 'Key to version the cache hash.'
required: true
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'

499
dist/index.js vendored

File diff suppressed because one or more lines are too long

3803
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,24 @@
{
"name": "cache-extensions",
"version": "1.6.2",
"version": "1.7.0",
"private": false,
"description": "Cache PHP extensions in GitHub Actions",
"main": "lib/cache.js",
"types": "lib/cache.d.ts",
"directories": {
"lib": "lib",
"test": "__tests__",
"src": "src"
},
"files": [
"lib",
"src"
],
"scripts": {
"build": "tsc",
"lint": "eslint **/*.ts --cache",
"format": "prettier --write **/*.ts && git add .",
"format-check": "prettier --check **/*.ts",
"lint": "eslint **/src/*.ts --cache --fix",
"format": "prettier --write **/src/*.ts && git add .",
"format-check": "prettier --check **/src/*.ts",
"release": "ncc build -o dist && git add -f dist/",
"test": "jest"
},
@@ -25,33 +35,32 @@
"author": "shivammathur",
"license": "MIT",
"dependencies": {
"@actions/cache": "^1.0.7",
"@actions/core": "^1.5.0",
"@actions/cache": "^1.0.8",
"@actions/core": "^1.6.0",
"@actions/exec": "^1.1.0",
"setup-php": "^2.14.0"
"setup-php": "2.15.0"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@types/node": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"@vercel/ncc": "^0.31.1",
"eslint": "^7.32.0",
"@types/jest": "^27.0.3",
"@types/node": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"@vercel/ncc": "^0.33.0",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.2",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^25.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^4.3.8",
"jest": "^27.2.0",
"jest-circus": "^27.2.0",
"prettier": "^2.4.1",
"ts-jest": "^27.0.5",
"typescript": "^4.4.3"
"jest": "^27.4.5",
"jest-circus": "^27.4.5",
"prettier": "^2.5.1",
"ts-jest": "^27.1.2",
"typescript": "^4.5.4"
},
"husky": {
"skipCI": true,
"hooks": {
"pre-commit": "npm run format && npm run lint && npm run test && npm run build && npm run release"
}
"bugs": {
"url": "https://github.com/shivammathur/cache-extensions/issues"
},
"simple-git-hooks": {
"pre-commit": "npm run format && npm run lint && npm run test && npm run build && npm run release"
}
}

View File

@@ -1,5 +1,6 @@
amqp
expect
gnupg
grpc
imagick
imap

View File

@@ -78,7 +78,7 @@ extension_dir_linux() {
data() {
old_versions="5.[3-5]"
date='20210919'
date='20211217'
if [ "$os" = "Linux" ]; then
. /etc/lsb-release
os=$os-$DISTRIB_CODENAME
@@ -86,18 +86,16 @@ data() {
dir=$(extension_dir_linux "$api_version")
sudo mkdir -p "$dir/deps" && fix_ownership "$dir"
elif [ "$os" = "Darwin" ]; then
date='20211006'
[[ "$extensions" == *"imap"* ]] && date='20211022'
api_version=$(get_api_version)
dir=$(extension_dir_darwin "$api_version")
sudo mkdir -p "$dir/deps" && fix_ownership "$dir"
else
os="Windows"
dir='C:\\tools\\php\\ext'
[[ "${version:?}" =~ 8.[1-2] ]] && date='20211124'
fi
key="$os"-ext-"$version"-$(echo -n "$extensions-$key" | openssl dgst -sha256 | cut -d ' ' -f 2)
key="$key-$date"
job="${GITHUB_REPOSITORY}-${GITHUB_WORKFLOW}-${GITHUB_JOB}"
key="$(echo -n "$extensions-$key-$job" | openssl dgst -sha256 | cut -d ' ' -f 2)"
key="$os"-"$version"-"$key"-"$date"
echo "$dir" > "${RUNNER_TEMP:?}"/dir
echo "$key" > "${RUNNER_TEMP:?}"/key
echo "::set-output name=dir::$dir"

View File

@@ -1,5 +1,6 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"lib": [
"ESNext"