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: on:
workflow_dispatch: workflow_dispatch:
schedule: 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] on: [push, pull_request]
jobs: jobs:
run: run:
@@ -8,10 +8,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Node.js 12.x - name: Setup Node.js 16.x
uses: actions/setup-node@v1 uses: actions/setup-node@v2
with: with:
node-version: 12.x node-version: 16.x
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install

View File

@@ -1,7 +1,7 @@
The MIT License (MIT) 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal 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.' description: 'Key to version the cache hash.'
required: true required: true
runs: runs:
using: 'node12' using: 'node16'
main: 'dist/index.js' 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", "name": "cache-extensions",
"version": "1.6.2", "version": "1.7.0",
"private": false, "private": false,
"description": "Cache PHP extensions in GitHub Actions", "description": "Cache PHP extensions in GitHub Actions",
"main": "lib/cache.js", "main": "lib/cache.js",
"types": "lib/cache.d.ts",
"directories": {
"lib": "lib",
"test": "__tests__",
"src": "src"
},
"files": [
"lib",
"src"
],
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"lint": "eslint **/*.ts --cache", "lint": "eslint **/src/*.ts --cache --fix",
"format": "prettier --write **/*.ts && git add .", "format": "prettier --write **/src/*.ts && git add .",
"format-check": "prettier --check **/*.ts", "format-check": "prettier --check **/src/*.ts",
"release": "ncc build -o dist && git add -f dist/", "release": "ncc build -o dist && git add -f dist/",
"test": "jest" "test": "jest"
}, },
@@ -25,33 +35,32 @@
"author": "shivammathur", "author": "shivammathur",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^1.0.7", "@actions/cache": "^1.0.8",
"@actions/core": "^1.5.0", "@actions/core": "^1.6.0",
"@actions/exec": "^1.1.0", "@actions/exec": "^1.1.0",
"setup-php": "^2.14.0" "setup-php": "2.15.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.1", "@types/jest": "^27.0.3",
"@types/node": "^16.9.2", "@types/node": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^4.31.1", "@typescript-eslint/parser": "^5.7.0",
"@vercel/ncc": "^0.31.1", "@vercel/ncc": "^0.33.0",
"eslint": "^7.32.0", "eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2", "eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^24.4.2", "eslint-plugin-jest": "^25.3.0",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"husky": "^4.3.8", "jest": "^27.4.5",
"jest": "^27.2.0", "jest-circus": "^27.4.5",
"jest-circus": "^27.2.0", "prettier": "^2.5.1",
"prettier": "^2.4.1", "ts-jest": "^27.1.2",
"ts-jest": "^27.0.5", "typescript": "^4.5.4"
"typescript": "^4.4.3"
}, },
"husky": { "bugs": {
"skipCI": true, "url": "https://github.com/shivammathur/cache-extensions/issues"
"hooks": { },
"pre-commit": "npm run format && npm run lint && npm run test && npm run build && npm run release" "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 amqp
expect expect
gnupg
grpc grpc
imagick imagick
imap imap

View File

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

View File

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