diff --git a/.github/actions/github-private-action/Dockerfile b/.github/actions/github-private-action/Dockerfile deleted file mode 100644 index 5333bc6..0000000 --- a/.github/actions/github-private-action/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -# Container image that runs your code -FROM node:12-slim - -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh - -# Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/github-private-action/action.yml b/.github/actions/github-private-action/action.yml deleted file mode 100644 index 03a6ab3..0000000 --- a/.github/actions/github-private-action/action.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Private Github Action' -description: 'Download a private github action' -inputs: - package: - description: 'Name of the Github Package' - required: true - token: - description: 'Personal Access Token with permission for Github Packages' - required: true - path: - description: 'Location within the path to put the ' - required: true - default: .gh-private-actions -runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.package }} - - ${{ inputs.path }} - - ${{ inputs.token }} diff --git a/.github/actions/github-private-action/entrypoint.sh b/.github/actions/github-private-action/entrypoint.sh deleted file mode 100755 index 06ac80a..0000000 --- a/.github/actions/github-private-action/entrypoint.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -############################################################## -# entrypoint.sh -# -set -e - -package=$1 -directory=$2 -token=$3 - -usage() { - echo "entrypoint.sh package directory token" - echo " package - Github package name" - echo " directory - directory to install package" - echo " token - Github Access Token with permissions for Github Packages" -} - -test_param() { - name=$1 - param=$2 - if test -z "${param}"; then - echo "ERROR: Missing arg ${name}" - usage - exit 1 - fi -} - -test_param "package" "${package}" -test_param "directory" "${directory}" -test_param "token" "${token}" - -# ------------ # - -install_directory=${GITHUB_WORKSPACE}/${directory} - -GITHUB_PACKAGE_TOKEN=${token} -export GITHUB_PACKAGE_TOKEN - -cd /tmp -npm config set '//npm.pkg.github.com/:_authToken' '${GITHUB_PACKAGE_TOKEN}' -npm config set '@wpmedia:registry' 'https://npm.pkg.github.com' - -npm install ${package} - -mkdir -p ${install_directory} -cp -R node_modules/* ${install_directory} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 318a831..25b11b6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,32 +11,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 - - name: Checkout Git-Version - uses: ./.github/actions/github-private-action - with: - package: '@wpmedia/git-version-action@0.1.9' - token: ${{ secrets.GITHUB_PACKAGE_TOKEN }} - - id: git_metadata + - id: metadata name: Get Git Metadata - uses: ./.gh-private-actions/@wpmedia/git-version-action - - name: Package - env: - PACKAGE_VERSION: ${{steps.git_metadata.outputs.git_version}} - run: | - project_version=$(node -e "console.log(require('./package.json').version);") - if test "$project_version" != "$PACKAGE_VERSION"; then echo "ERROR: '$project_version' != '$PACKAGE_VERSION'" && exit 1; fi - npm install - npm run package - - name: Publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - npm config set '//npm.pkg.github.com/:_authToken' '${GITHUB_TOKEN}' - npm publish --registry https://npm.pkg.github.com + uses: .WPMedia/git-version-action - name: Slack Notify if: success() uses: ./ with: token: ${{ secrets.SLACK_BOT_TOKEN }} - payload: '{ "channel": "#post-unleashed-ops", "text": "Build `${{ github.repository }}@${{ steps.git_metadata.outputs.git_version }}` was successful" }' + payload: '{ "channel": "#publishing-tools-ops", "text": "Build `${{ github.repository }}@${{ steps.git_metadata.outputs.git_version }}` was successful" }' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 997dcf8..e800848 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,4 +12,4 @@ jobs: - uses: ./ with: token: ${{ secrets.SLACK_BOT_TOKEN }} - payload: '{ "channel": "#post-unleashed-ops", "text": "Slack message test for `${{ github.repository }}@${{ github.sha }}` " }' \ No newline at end of file + payload: '{ "channel": "#publishing-tools-ops", "text": "Slack message test for `${{ github.repository }}@${{ github.sha }}` " }' \ No newline at end of file diff --git a/LICENSE b/LICENSE index 7efcb83..362d1bf 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1,21 @@ -Copyright © 2020 The Washington Post. All rights reserved. +MIT License + +Copyright (c) 2020 The Washington Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json index c1dd4a3..72c0c36 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "url": "git+https://github.com/WPMedia/slack-action.git" }, "author": "", - "license": "SEE LICENSE IN LICENSE", + "license": "MIT", "bugs": { "url": "https://github.com/WPMedia/slack-action/issues" },