Compare commits

...

14 Commits

Author SHA1 Message Date
Oleksandr Bordun 7f2a916727 Update CHANGELOG.md 2019-04-22 14:05:55 +02:00
Oleksandr Bordun 5a59b2b2ae Merge pull request #5 from Embraser01/patch-1
Backport some changes from npm actions
2019-04-22 14:01:21 +02:00
Oleksandr Bordun 658f66ff0b Merge branch 'master' into patch-1 2019-04-22 12:19:13 +02:00
Oleksandr Bordun 433d223b19 Fixing Dockerfilelint action 2019-04-22 12:17:11 +02:00
Oleksandr Bordun 7ba8158c63 Update main.workflow 2019-04-22 11:44:37 +02:00
Oleksandr Bordun 02dfec60b1 Updating main workflow 2019-04-22 11:35:55 +02:00
Oleksandr Bordun 05eb7c3a78 Update main.workflow 2019-04-22 01:00:10 +02:00
Oleksandr Bordun 2f417a09c0 Fixing Docker Lint 2019-04-22 00:28:20 +02:00
Oleksandr Bordun 6f4d654ec1 Adding PR tests 2019-04-21 23:42:36 +02:00
Marc-Antoine 097057d996 Use full node image
NPM for Github actions uses the full node image from docker.

I need it because some of my dependencies need python and slim version does not seems to have it.

More here: https://github.com/actions/npm/issues/8
2019-04-21 21:45:04 +02:00
Marc-Antoine ae944a02b7 Backport entrypoint.sh from npm action
I just backported changes made in the NPM action
2019-04-21 21:40:20 +02:00
Oleksandr Bordun ed3b33b7fe Merge pull request #4 from Embraser01/patch-1
Fix action preview (capitalize Borales)
2019-04-21 14:47:33 +02:00
Marc-Antoine a918ccf9e6 Fix action preview (capitalize Borales)
Without it, Github action can't load meta data (icon color, name, etc.)
2019-04-21 11:43:46 +02:00
Oleksandr Bordun e207ae44f5 Updating color 2019-03-09 14:08:35 +01:00
5 changed files with 70 additions and 25 deletions
+50 -16
View File
@@ -1,49 +1,83 @@
workflow "Pull Request" {
on = "pull_request"
resolves = ["Docker Lint [PR]", "Shell Lint [PR]", "Test [PR]"]
}
action "Docker Lint [PR]" {
uses = "docker://replicated/dockerfilelint"
args = "Dockerfile"
}
action "Shell Lint [PR]" {
uses = "actions/bin/shellcheck@master"
args = "entrypoint.sh"
}
action "Test [PR]" {
uses = "actions/bin/bats@master"
args = "test/*.bats"
}
workflow "Build and Publish" {
resolves = [
"Docker Lint",
"Test",
"Docker Login",
"Docker Publish",
]
on = "push"
resolves = "Docker Publish"
}
action "Master Branch" {
uses = "actions/bin/filter@master"
args = "branch master"
}
action "Docker Lint" {
uses = "docker://replicated/dockerfilelint"
needs = ["Master Branch"]
args = "Dockerfile"
}
action "Shell Lint" {
uses = "actions/bin/shellcheck@master"
needs = ["Master Branch"]
args = "entrypoint.sh"
}
action "Test" {
uses = "actions/bin/bats@master"
needs = ["Master Branch"]
args = "test/*.bats"
}
action "Docker Lint" {
uses = "docker://replicated/dockerfilelint"
args = ["Dockerfile"]
}
action "Build" {
needs = ["Shell Lint", "Test", "Docker Lint"]
uses = "actions/docker/cli@master"
needs = [
"Docker Lint",
"Test",
"Shell Lint",
]
args = "build -t yarn ."
}
action "Docker Tag" {
needs = ["Build"]
uses = "actions/docker/tag@master"
args = "yarn borales/yarn --no-latest"
}
action "Publish Filter" {
needs = ["Build"]
uses = "actions/bin/filter@master"
args = "branch master"
}
action "Docker Login" {
needs = ["Publish Filter"]
uses = "actions/docker/login@master"
secrets = ["DOCKER_USERNAME", "DOCKER_PASSWORD"]
secrets = ["DOCKER_PASSWORD", "DOCKER_USERNAME"]
needs = ["Build"]
}
action "Docker Publish" {
needs = ["Docker Tag", "Docker Login"]
uses = "actions/docker/cli@master"
needs = [
"Docker Login",
"Docker Tag",
]
args = "push borales/yarn"
}
+5 -1
View File
@@ -1,5 +1,9 @@
# CHANGELOG
### 27 Dec 2018
## 1.1.0 (22 Apr 2019)
- Docker now uses the full image `node:10` and `entrypoint.sh` accepts extra NPM settings (thanks to [@Embraser01](https://github.com/Embraser01))
## 1.0.0 (27 Dec 2018)
- Added Docker credentials
+3 -3
View File
@@ -1,6 +1,6 @@
FROM node:10-slim
FROM node:10
LABEL version="1.0.0"
LABEL version="1.1.0"
LABEL repository="https://github.com/Borales/actions-yarn"
LABEL homepage="https://github.com/Borales/actions-yarn"
LABEL maintainer="Oleksandr Bordun <bordun.alexandr@gmail.com>"
@@ -8,7 +8,7 @@ LABEL maintainer="Oleksandr Bordun <bordun.alexandr@gmail.com>"
LABEL com.github.actions.name="GitHub Action for Yarn"
LABEL com.github.actions.description="Wraps the yarn CLI to enable common yarn commands."
LABEL com.github.actions.icon="package"
LABEL com.github.actions.color="#2188b6"
LABEL com.github.actions.color="blue"
# COPY LICENSE README.md THIRD_PARTY_NOTICE.md /
COPY "entrypoint.sh" "/entrypoint.sh"
+4 -4
View File
@@ -15,19 +15,19 @@ workflow "Build, Test, and Publish" {
}
action "Build" {
uses = "borales/actions-yarn@master"
uses = "Borales/actions-yarn@master"
args = "install"
}
action "Test" {
needs = "Build"
uses = "borales/actions-yarn@master"
uses = "Borales/actions-yarn@master"
args = "test"
}
action "Publish" {
needs = "Test"
uses = "borales/actions-yarn@master"
uses = "Borales/actions-yarn@master"
args = "publish --access public"
secrets = ["NPM_AUTH_TOKEN"]
}
@@ -48,7 +48,7 @@ To authenticate with, and publish to, a registry other than `registry.npmjs.org`
```hcl
action "Publish" {
uses = "borales/actions-yarn@master"
uses = "Borales/actions-yarn@master"
args = "publish --access public"
env = {
NPM_REGISTRY_URL = "someOtherRegistry.someDomain.net"
+8 -1
View File
@@ -6,9 +6,16 @@ if [ -n "$NPM_AUTH_TOKEN" ]; then
# Respect NPM_CONFIG_USERCONFIG if it is provided, default to $HOME/.npmrc
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG-"$HOME/.npmrc"}"
NPM_REGISTRY_URL="${NPM_REGISTRY_URL-registry.npmjs.org}"
NPM_STRICT_SSL="${NPM_STRICT_SSL-true}"
NPM_REGISTRY_SCHEME="https"
if ! $NPM_STRICT_SSL
then
NPM_REGISTRY_SCHEME="http"
fi
# Allow registry.npmjs.org to be overridden with an environment variable
printf "//%s/:_authToken=%s\\nregistry=%s" "$NPM_REGISTRY_URL" "$NPM_AUTH_TOKEN" "$NPM_REGISTRY_URL" > "$NPM_CONFIG_USERCONFIG"
printf "//%s/:_authToken=%s\\nregistry=%s\\nstrict-ssl=%s" "$NPM_REGISTRY_URL" "$NPM_AUTH_TOKEN" "${NPM_REGISTRY_SCHEME}://$NPM_REGISTRY_URL" "${NPM_STRICT_SSL}" > "$NPM_CONFIG_USERCONFIG"
chmod 0600 "$NPM_CONFIG_USERCONFIG"
fi