Skip to content

Commit 1f0d06e

Browse files
committed
Start converting the template to the actual Action
Let's change the README and the package.json/action.yml files to reflect that we're developing `setup-git-for-windows-sdk` here. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 868ce7d commit 1f0d06e

File tree

6 files changed

+61
-84
lines changed

6 files changed

+61
-84
lines changed

.markdownlint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"MD014": false
3+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2+
"cSpell.ignoreRegExpList": [
3+
"mingw-w64-git"
4+
],
25
"cSpell.words": [
6+
"Pacman",
37
"vercel"
48
]
59
}

README.md

Lines changed: 44 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,73 @@
1-
<p align="center">
2-
<a href="https://github.com/actions/typescript-action/actions"><img alt="typescript-action status" src="https://github.com/actions/typescript-action/workflows/build-test/badge.svg"></a>
3-
</p>
1+
# Set up a Git for Windows SDK (or a subset thereof)
42

5-
# Create a JavaScript Action using TypeScript
3+
Use this Action to initialize an environment to develop Git for Windows.
64

7-
Use this template to bootstrap the creation of a TypeScript action.:rocket:
5+
## Getting Started
86

9-
This template includes compilation support, tests, a validation workflow, publishing, and versioning guidance.
10-
11-
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
12-
13-
## Create an action from this template
14-
15-
Click the `Use this Template` and provide the new repo details for your action
16-
17-
## Code in Main
18-
19-
> First, you'll need to have a reasonably modern version of `node` handy. This won't work with versions older than 9, for instance.
20-
21-
Install the dependencies
22-
```bash
23-
$ npm install
24-
```
25-
26-
Build the typescript and package it for distribution
27-
```bash
28-
$ npm run build && npm run package
7+
```yaml
8+
name: Build stuff in Git for Windows' SDK
9+
on: [push]
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup Git for Windows' minimal SDK
16+
uses: git-for-windows/setup-git-for-windows-sdk@v1
17+
- name: Build
18+
shell: bash
19+
run: make
2920
```
3021
31-
Run the tests :heavy_check_mark:
32-
```bash
33-
$ npm test
22+
## Available flavors
3423
35-
PASS ./index.test.js
36-
✓ throws invalid number (3ms)
37-
wait 500 ms (504ms)
38-
test runs (95ms)
24+
It supports several flavors:
3925
40-
...
41-
```
26+
- `minimal`:
4227

43-
## Change action.yml
28+
This is the most useful flavor to build Git for Windows' source code and run its own test suite. Only available for x86_64.
4429

45-
The action.yml contains defines the inputs and output for your action.
30+
- `makepkg-git`:
4631

47-
Update the action.yml with your name, description, inputs and outputs for your action.
32+
This flavor allows packaging `mingw-w64-git`, the Pacman package. It is only available for x86_64 but can be used to "cross-compile" for i686.
4833

49-
See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
34+
- `build-installers`:
5035

51-
## Change the Code
36+
In addition to building `mingw-w64-git`, this flavor allows bundling Git for Windows' artifacts such as the installer and the Portable Git.
5237

53-
Most toolkit and CI/CD operations involve async operations so the action is run in an async function.
38+
- `full`:
5439

55-
```javascript
56-
import * as core from '@actions/core';
57-
...
40+
This is the "full" SDK, [as users would install it](https://gitforwindows.org/#download-sdk), with a pre-selected set of packages pre-installed. Additional packages can be installed via `pacman -S <package>`.
5841

59-
async function run() {
60-
try {
61-
...
62-
}
63-
catch (error) {
64-
core.setFailed(error.message);
65-
}
66-
}
42+
## CPU architecture support
6743

68-
run()
69-
```
44+
The Git for Windows SDK can be installed targeting `x86_64` (AKA "64-bit") and `i686` (AKA 32-bit).
7045

71-
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
46+
## Developing _this_ Action
7247

73-
## Publish to a distribution branch
48+
> First, you'll need to have a reasonably modern version of `node` handy, such as Node 12.
7449

75-
Actions are run from GitHub repos so we will checkin the packed dist folder.
50+
Install the dependencies
7651

77-
Then run [ncc](https://github.com/zeit/ncc) and push the results:
7852
```bash
79-
$ npm run package
80-
$ git add dist
81-
$ git commit -a -m "prod dependencies"
82-
$ git push origin releases/v1
53+
$ npm install
8354
```
8455

85-
Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project.
56+
Build the Action and package it for distribution
8657

87-
Your action is now published! :rocket:
58+
```bash
59+
$ npm run build && npm run package
60+
```
8861

89-
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
62+
Run the tests :heavy_check_mark:
9063

91-
## Validate
64+
```bash
65+
$ npm test
9266
93-
You can now validate the action by referencing `./` in a workflow in your repo (see [test.yml](.github/workflows/test.yml))
67+
PASS ./index.test.js
68+
✓ throws invalid number (3ms)
69+
✓ wait 500 ms (504ms)
70+
✓ test runs (95ms)
9471
95-
```yaml
96-
uses: ./
97-
with:
98-
milliseconds: 1000
72+
...
9973
```
100-
101-
See the [actions tab](https://github.com/actions/typescript-action/actions) for runs of this action! :rocket:
102-
103-
## Usage:
104-
105-
After testing you can [create a v1 tag](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) to reference the stable and latest V1 action

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: 'Your name here'
2-
description: 'Provide a description here'
3-
author: 'Your name or organization here'
1+
name: 'Setup Git for Windows SDK'
2+
description: 'Set up an environment to develop Git for Windows'
3+
author: 'Johannes Schindelin'
44
inputs:
55
milliseconds: # change this
66
required: true

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "typescript-action",
2+
"name": "setup-git-for-windows-sdk",
33
"version": "0.0.0",
44
"private": true,
5-
"description": "TypeScript template action",
5+
"description": "Set up an environment to develop Git for WindowsTypeScript template action",
66
"main": "lib/main.js",
77
"scripts": {
88
"build": "tsc",
@@ -15,12 +15,14 @@
1515
},
1616
"repository": {
1717
"type": "git",
18-
"url": "git+https://github.com/actions/typescript-action.git"
18+
"url": "git+https://github.com/git-for-windows/setup-git-for-windows-sdk.git"
1919
},
2020
"keywords": [
2121
"actions",
2222
"node",
23-
"setup"
23+
"setup",
24+
"git",
25+
"git-for-windows"
2426
],
2527
"author": "",
2628
"license": "MIT",

0 commit comments

Comments
 (0)