mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 11:06:53 +08:00
Use @zeit/ncc to distribute action
This commit is contained in:
5
.github/workflows/example-builds-nightly.yml
vendored
5
.github/workflows/example-builds-nightly.yml
vendored
@@ -23,7 +23,10 @@ jobs:
|
|||||||
- uses: actions/checkout@v1.0.0
|
- uses: actions/checkout@v1.0.0
|
||||||
|
|
||||||
- name: "Install dependencies"
|
- name: "Install dependencies"
|
||||||
run: npm install --production
|
run: |
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
npm run pack
|
||||||
|
|
||||||
- name: "Set up Julia (nightly)"
|
- name: "Set up Julia (nightly)"
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
5
.github/workflows/example-builds.yml
vendored
5
.github/workflows/example-builds.yml
vendored
@@ -20,7 +20,10 @@ jobs:
|
|||||||
- uses: actions/checkout@v1.0.0
|
- uses: actions/checkout@v1.0.0
|
||||||
|
|
||||||
- name: "Install dependencies"
|
- name: "Install dependencies"
|
||||||
run: npm install --production
|
run: |
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
npm run pack
|
||||||
|
|
||||||
- name: "Set up Julia"
|
- name: "Set up Julia"
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
__tests__/runner/*
|
__tests__/runner/*
|
||||||
|
dist/
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ inputs:
|
|||||||
default: 'false'
|
default: 'false'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/setup-julia.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'download'
|
icon: 'download'
|
||||||
color: 'green'
|
color: 'green'
|
||||||
|
|||||||
@@ -1,13 +1,44 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
git checkout -b releases/"$1"
|
branch_name="$(git symbolic-ref --short -q HEAD)"
|
||||||
|
version="v$(jq -r .version package.json)"
|
||||||
|
repo="$1"
|
||||||
|
|
||||||
|
if [ -z "$repo" ]; then
|
||||||
|
echo "ERROR: must specify repository"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== debug info ==="
|
||||||
|
echo "branch: $branch_name"
|
||||||
|
echo "version: $version"
|
||||||
|
echo "repo: $repo"
|
||||||
|
echo "=================="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check that the version doesn't exist yet
|
||||||
|
version_exists="$(curl -s https://api.github.com/repos/"$repo"/tags -H "Accept: application/vnd.github.v3.full+json" | jq -r '.[] | select(.name == "'"$version"'") | .name')"
|
||||||
|
if [ -n "$version_exists" ]; then
|
||||||
|
echo "ERROR: version $version already exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git checkout -b releases/"$version"
|
||||||
|
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
npm test
|
npm test
|
||||||
npm prune --production
|
npm run pack
|
||||||
|
|
||||||
sed -i 's/node_modules/!node_modules/g' .gitignore
|
sed -i 's/dist/!dist/g' .gitignore
|
||||||
git add node_modules
|
git add dist
|
||||||
git commit -a -m "Add production dependencies & build"
|
git commit -a -m "Add production dependencies & build"
|
||||||
git tag "$1"
|
|
||||||
|
# Tags
|
||||||
|
major_minor="$(sed 's/\.[^.]*$//' <<< "$version")"
|
||||||
|
major="$(sed 's/\.[^.]*$//' <<< "$major_minor")"
|
||||||
|
|
||||||
|
git tag "$version"
|
||||||
|
git tag -f "$major_minor"
|
||||||
|
git tag -f "$major"
|
||||||
|
git tag -f "latest"
|
||||||
|
|||||||
@@ -1,14 +1,36 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
branch_name="$(git symbolic-ref --short -q HEAD)"
|
branch_name="$(git symbolic-ref --short -q HEAD)"
|
||||||
|
version="v$(jq -r .version package.json)"
|
||||||
|
repo="$1"
|
||||||
|
|
||||||
git checkout -B test/"$branch_name"
|
if [ -z "$repo" ]; then
|
||||||
|
echo "ERROR: must specify repository"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== debug info ==="
|
||||||
|
echo "branch: $branch_name"
|
||||||
|
echo "version: $version"
|
||||||
|
echo "repo: $repo"
|
||||||
|
echo "=================="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check that the version doesn't exist yet
|
||||||
|
version_exists="$(curl -s https://api.github.com/repos/"$repo"/tags -H "Accept: application/vnd.github.v3.full+json" | jq -r '.[] | select(.name == "'"$version"'") | .name')"
|
||||||
|
if [ -n "$version_exists" ]; then
|
||||||
|
echo "ERROR: version $version already exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git checkout -B test/"$branch_name"/releases/"$version"
|
||||||
|
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
npm test
|
npm test
|
||||||
npm prune --production
|
npm run pack
|
||||||
|
|
||||||
sed -i 's/node_modules/!node_modules/g' .gitignore
|
# Add dist/ to git and commit it
|
||||||
git add node_modules
|
sed -i 's/dist/!dist/g' .gitignore
|
||||||
|
git add dist
|
||||||
git commit -a -m "Add production dependencies & build"
|
git commit -a -m "Add production dependencies & build"
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1495,6 +1495,12 @@
|
|||||||
"integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==",
|
"integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@zeit/ncc": {
|
||||||
|
"version": "0.22.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.0.tgz",
|
||||||
|
"integrity": "sha512-zaS6chwztGSLSEzsTJw9sLTYxQt57bPFBtsYlVtbqGvmDUsfW7xgXPYofzFa1kB9ur2dRop6IxCwPnWLBVCrbQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"abab": {
|
"abab": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz",
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-julia",
|
"name": "setup-julia",
|
||||||
"version": "0.1.0",
|
"version": "1.1.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup Julia action",
|
"description": "setup Julia action",
|
||||||
"main": "lib/setup-julia.js",
|
"main": "lib/setup-julia.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"format": "prettier --single-quote --print-width 120 --tab-width 4 --no-semi --write **/*.ts",
|
"pack": "ncc build",
|
||||||
"format-check": "prettier --single-quote --print-width 120 --tab-width 4 --no-semi --check **/*.ts",
|
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -32,6 +31,7 @@
|
|||||||
"@types/jest": "^24.0.13",
|
"@types/jest": "^24.0.13",
|
||||||
"@types/node": "^12.12.7",
|
"@types/node": "^12.12.7",
|
||||||
"@types/semver": "^6.0.0",
|
"@types/semver": "^6.0.0",
|
||||||
|
"@zeit/ncc": "^0.22.0",
|
||||||
"jest": "^24.8.0",
|
"jest": "^24.8.0",
|
||||||
"jest-circus": "^24.7.1",
|
"jest-circus": "^24.7.1",
|
||||||
"prettier": "^1.17.1",
|
"prettier": "^1.17.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user