Skip to content

Commit

Permalink
feat: initial version (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored Apr 26, 2021
1 parent d67c4bc commit 58c38d3
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release
on:
push:
branches:
- master
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm ci
- run: npm run build
- run: rm .gitignore # dist/ folder is ignored by default
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GR2M_PAT_FOR_SEMANTIC_RELEASE }}
- run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v1.x"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on: [push]
name: Test
jobs:
readmeExamples:
name: "[TEST] README examples"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v2
with:
node-version: 14
- run: "npm ci"
- run: "npm run build"
- name: "Minimal README example"
uses: ./
id: hello_world
- name: "README example with custom greeting"
uses: ./
id: hello_world_greeting
with:
greeting: "Gregor"
- run: node -e 'assert.equal("${{ steps.hello_world.outputs.greeting }}", "Hello, world!")'
- run: node -e 'assert.equal("${{ steps.hello_world_greeting.outputs.greeting }}", "Hello, Gregor!")'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# 🚧 WORK IN PROGRESS – see [#1](https://github.com/gr2m/hello-world-action/pull/1) | [preview](https://github.com/gr2m/hello-world-action/tree/initial-version#readme)

# Hello World Action

> A simple GitHub Action written in JavaScript
Expand Down
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Hello, world!
description: "A simple GitHub Action written in JavaScript"
branding:
icon: "clipboard"
color: yellow
inputs:
greeting:
description: "Custom media type in the Accept header"
required: false
default: "world"
outputs:
greeting:
description: "The full greeting text"
runs:
using: "node12"
main: "dist/index.js"
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import core from "@actions/core";

const greeting = core.getInput("greeting");
const output = `Hello, ${greeting}!`;

core.info(output);

core.setOutput("greeting", output);
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "hello-world-action",
"version": "1.0.0",
"private": true,
"type": "module",
"description": "A simple GitHub Action written in JavaScript",
"main": "dist/index.js",
"scripts": {
"build": "ncc build index.js -o dist"
},
"repository": "github:gr2m/hello-world-action",
"keywords": [
"github-action"
],
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "ISC",
"dependencies": {
"@actions/core": "^1.2.7"
},
"devDependencies": {
"@vercel/ncc": "^0.28.3"
},
"release": {
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/git",
{
"assets": [
"dist/index.js"
],
"message": "build(release): compiled action for ${nextRelease.version}\n\n[skip ci]"
}
],
"@semantic-release/github"
]
}
}

0 comments on commit 58c38d3

Please sign in to comment.