mirror of
https://github.com/Borales/actions-yarn.git
synced 2026-06-27 02:49:28 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f2a916727 | |||
| 5a59b2b2ae | |||
| 658f66ff0b | |||
| 433d223b19 | |||
| 7ba8158c63 | |||
| 02dfec60b1 | |||
| 05eb7c3a78 | |||
| 2f417a09c0 | |||
| 6f4d654ec1 | |||
| 097057d996 | |||
| ae944a02b7 | |||
| ed3b33b7fe | |||
| a918ccf9e6 | |||
| e207ae44f5 |
+50
-16
@@ -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" {
|
workflow "Build and Publish" {
|
||||||
|
resolves = [
|
||||||
|
"Docker Lint",
|
||||||
|
"Test",
|
||||||
|
"Docker Login",
|
||||||
|
"Docker Publish",
|
||||||
|
]
|
||||||
on = "push"
|
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" {
|
action "Shell Lint" {
|
||||||
uses = "actions/bin/shellcheck@master"
|
uses = "actions/bin/shellcheck@master"
|
||||||
|
needs = ["Master Branch"]
|
||||||
args = "entrypoint.sh"
|
args = "entrypoint.sh"
|
||||||
}
|
}
|
||||||
|
|
||||||
action "Test" {
|
action "Test" {
|
||||||
uses = "actions/bin/bats@master"
|
uses = "actions/bin/bats@master"
|
||||||
|
needs = ["Master Branch"]
|
||||||
args = "test/*.bats"
|
args = "test/*.bats"
|
||||||
}
|
}
|
||||||
|
|
||||||
action "Docker Lint" {
|
|
||||||
uses = "docker://replicated/dockerfilelint"
|
|
||||||
args = ["Dockerfile"]
|
|
||||||
}
|
|
||||||
|
|
||||||
action "Build" {
|
action "Build" {
|
||||||
needs = ["Shell Lint", "Test", "Docker Lint"]
|
|
||||||
uses = "actions/docker/cli@master"
|
uses = "actions/docker/cli@master"
|
||||||
|
needs = [
|
||||||
|
"Docker Lint",
|
||||||
|
"Test",
|
||||||
|
"Shell Lint",
|
||||||
|
]
|
||||||
args = "build -t yarn ."
|
args = "build -t yarn ."
|
||||||
}
|
}
|
||||||
|
|
||||||
action "Docker Tag" {
|
action "Docker Tag" {
|
||||||
needs = ["Build"]
|
|
||||||
uses = "actions/docker/tag@master"
|
uses = "actions/docker/tag@master"
|
||||||
args = "yarn borales/yarn --no-latest"
|
args = "yarn borales/yarn --no-latest"
|
||||||
}
|
|
||||||
|
|
||||||
action "Publish Filter" {
|
|
||||||
needs = ["Build"]
|
needs = ["Build"]
|
||||||
uses = "actions/bin/filter@master"
|
|
||||||
args = "branch master"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
action "Docker Login" {
|
action "Docker Login" {
|
||||||
needs = ["Publish Filter"]
|
|
||||||
uses = "actions/docker/login@master"
|
uses = "actions/docker/login@master"
|
||||||
secrets = ["DOCKER_USERNAME", "DOCKER_PASSWORD"]
|
secrets = ["DOCKER_PASSWORD", "DOCKER_USERNAME"]
|
||||||
|
needs = ["Build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
action "Docker Publish" {
|
action "Docker Publish" {
|
||||||
needs = ["Docker Tag", "Docker Login"]
|
|
||||||
uses = "actions/docker/cli@master"
|
uses = "actions/docker/cli@master"
|
||||||
|
needs = [
|
||||||
|
"Docker Login",
|
||||||
|
"Docker Tag",
|
||||||
|
]
|
||||||
args = "push borales/yarn"
|
args = "push borales/yarn"
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -1,5 +1,9 @@
|
|||||||
# CHANGELOG
|
# 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
|
- Added Docker credentials
|
||||||
|
|||||||
+3
-3
@@ -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 repository="https://github.com/Borales/actions-yarn"
|
||||||
LABEL homepage="https://github.com/Borales/actions-yarn"
|
LABEL homepage="https://github.com/Borales/actions-yarn"
|
||||||
LABEL maintainer="Oleksandr Bordun <bordun.alexandr@gmail.com>"
|
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.name="GitHub Action for Yarn"
|
||||||
LABEL com.github.actions.description="Wraps the yarn CLI to enable common yarn commands."
|
LABEL com.github.actions.description="Wraps the yarn CLI to enable common yarn commands."
|
||||||
LABEL com.github.actions.icon="package"
|
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 LICENSE README.md THIRD_PARTY_NOTICE.md /
|
||||||
|
|
||||||
COPY "entrypoint.sh" "/entrypoint.sh"
|
COPY "entrypoint.sh" "/entrypoint.sh"
|
||||||
|
|||||||
@@ -15,19 +15,19 @@ workflow "Build, Test, and Publish" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
action "Build" {
|
action "Build" {
|
||||||
uses = "borales/actions-yarn@master"
|
uses = "Borales/actions-yarn@master"
|
||||||
args = "install"
|
args = "install"
|
||||||
}
|
}
|
||||||
|
|
||||||
action "Test" {
|
action "Test" {
|
||||||
needs = "Build"
|
needs = "Build"
|
||||||
uses = "borales/actions-yarn@master"
|
uses = "Borales/actions-yarn@master"
|
||||||
args = "test"
|
args = "test"
|
||||||
}
|
}
|
||||||
|
|
||||||
action "Publish" {
|
action "Publish" {
|
||||||
needs = "Test"
|
needs = "Test"
|
||||||
uses = "borales/actions-yarn@master"
|
uses = "Borales/actions-yarn@master"
|
||||||
args = "publish --access public"
|
args = "publish --access public"
|
||||||
secrets = ["NPM_AUTH_TOKEN"]
|
secrets = ["NPM_AUTH_TOKEN"]
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ To authenticate with, and publish to, a registry other than `registry.npmjs.org`
|
|||||||
|
|
||||||
```hcl
|
```hcl
|
||||||
action "Publish" {
|
action "Publish" {
|
||||||
uses = "borales/actions-yarn@master"
|
uses = "Borales/actions-yarn@master"
|
||||||
args = "publish --access public"
|
args = "publish --access public"
|
||||||
env = {
|
env = {
|
||||||
NPM_REGISTRY_URL = "someOtherRegistry.someDomain.net"
|
NPM_REGISTRY_URL = "someOtherRegistry.someDomain.net"
|
||||||
|
|||||||
+8
-1
@@ -6,9 +6,16 @@ if [ -n "$NPM_AUTH_TOKEN" ]; then
|
|||||||
# Respect NPM_CONFIG_USERCONFIG if it is provided, default to $HOME/.npmrc
|
# Respect NPM_CONFIG_USERCONFIG if it is provided, default to $HOME/.npmrc
|
||||||
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG-"$HOME/.npmrc"}"
|
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG-"$HOME/.npmrc"}"
|
||||||
NPM_REGISTRY_URL="${NPM_REGISTRY_URL-registry.npmjs.org}"
|
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
|
# 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"
|
chmod 0600 "$NPM_CONFIG_USERCONFIG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user