-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} |