diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 0000000..d4afe79 --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,236 @@ +name: 'action' +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 3,6' +jobs: + + powershell: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + - name: test + run: | + $env:MSYSTEM = 'MSYS' + msys2 ./test.sh MSYS + $env:MSYSTEM = 'MINGW64' + msys2 ./test.sh MINGW64 + $env:MSYSTEM = 'MINGW32' + msys2 ./test.sh MINGW32 + + cmd: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + - name: test + shell: cmd + run: | + set MSYSTEM=MSYS + msys2 ./test.sh MSYS + set MSYSTEM=MINGW64 + msys2 ./test.sh MINGW64 + set MSYSTEM=MINGW32 + msys2 ./test.sh MINGW32 + + env: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + - name: test MSYS + run: msys2 ./test.sh MSYS + env: + MSYSTEM: MSYS + - name: test MINGW64 + run: msys2 ./test.sh MINGW64 + env: + MSYSTEM: MINGW64 + - name: test MINGW32 + run: msys2 ./test.sh MINGW32 + env: + MSYSTEM: MINGW32 + + shell: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + - shell: msys2 {0} + run: | + uname -a + pacman -Syu --noconfirm + + msystem: + strategy: + matrix: + task: [ MSYS, MINGW64, MINGW32 ] + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + with: + msystem: ${{ matrix.task }} + - run: msys2 ./test.sh ${{ matrix.task }} + + update: + strategy: + fail-fast: false + max-parallel: 3 + matrix: + msystem: [ MSYS, MINGW64, MINGW32 ] + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + with: + update: true + msystem: ${{ matrix.msystem }} + - run: msys2 ./test.sh ${{ matrix.msystem }} + + MSYS2_PATH_TYPE: + runs-on: windows-latest + steps: + - uses: actions/setup-go@v1 + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + - run: msys2 go env + env: + MSYS2_PATH_TYPE: inherit + + path-type: + runs-on: windows-latest + steps: + - uses: actions/setup-go@v1 + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + with: + path-type: inherit + - run: msys2 go env + + install: + strategy: + fail-fast: false + max-parallel: 3 + matrix: + install: [ false, git, 'base-devel git' ] + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + with: + update: true + install: ${{ matrix.install }} + msystem: MINGW64 + - run: msys2 ./test.sh MINGW64 + + defaultclean: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - run: git config --global core.autocrlf input + shell: bash + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + with: + update: true + install: base-devel git + - run: git describe --dirty --tags + + defaultdirty: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: build action + shell: bash + run: | + npm ci + npm run pkg + rm -rf node_modules + - name: run action + uses: ./ + with: + update: true + install: base-devel git + - run: git describe --dirty --tags diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 551656b..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: 'action' -on: - push: - pull_request: - schedule: - - cron: '0 0 * * 3,6' -jobs: - - powershell: - runs-on: windows-latest - steps: - - uses: actions/checkout@v1 - - name: install deps - run: npm ci - - name: run action - uses: ./ - - name: test MSYS - run: | - $env:MSYSTEM = 'MSYS' - msys2do ./test.sh MSYS - - name: test MINGW64 - run: | - $env:MSYSTEM = 'MINGW64' - msys2do ./test.sh MINGW64 - - name: test MINGW32 - run: | - $env:MSYSTEM = 'MINGW32' - msys2do ./test.sh MINGW32 - - cmd: - runs-on: windows-latest - steps: - - uses: actions/checkout@v1 - - name: install deps - run: npm ci - - name: run action - uses: ./ - - name: test MSYS - shell: cmd - run: | - set MSYSTEM=MSYS - msys2do ./test.sh MSYS - - name: test MINGW64 - shell: cmd - run: | - set MSYSTEM=MINGW64 - msys2do ./test.sh MINGW64 - - name: test MINGW32 - shell: cmd - run: | - set MSYSTEM=MINGW32 - msys2do ./test.sh MINGW32 - - env: - runs-on: windows-latest - steps: - - uses: actions/checkout@v1 - - name: install deps - run: npm ci - - name: run action - uses: ./ - - name: test MSYS - run: msys2do ./test.sh MSYS - env: - MSYSTEM: MSYS - - name: test MINGW64 - run: msys2do ./test.sh MINGW64 - env: - MSYSTEM: MINGW64 - - name: test MINGW32 - run: msys2do ./test.sh MINGW32 - env: - MSYSTEM: MINGW32 - - msystem: - strategy: - matrix: - task: [ MSYS, MINGW64, MINGW32 ] - runs-on: windows-latest - steps: - - uses: actions/checkout@v1 - - name: install deps - run: npm ci - - name: run action - uses: ./ - with: - msystem: ${{ matrix.task }} - - run: msys2do ./test.sh ${{ matrix.task }} - - update: - strategy: - matrix: - task: [ MSYS, MINGW64, MINGW32 ] - runs-on: windows-latest - steps: - - uses: actions/checkout@v1 - - name: install deps - run: npm ci - - name: run action - uses: ./ - with: - update: True - msystem: ${{ matrix.task }} - - run: msys2do ./test.sh ${{ matrix.task }} - - MSYS2_PATH_TYPE: - runs-on: windows-latest - steps: - - uses: actions/setup-go@v1 - - uses: actions/checkout@v1 - - run: yarn - - uses: ./ - - run: msys2do go env - env: - MSYS2_PATH_TYPE: inherit - - path-type: - runs-on: windows-latest - steps: - - uses: actions/setup-go@v1 - - uses: actions/checkout@v1 - - run: yarn - - uses: ./ - with: - path-type: inherit - - run: msys2do go env diff --git a/README.md b/README.md index b035c49..639da01 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,56 @@ # Setup MSYS2

- - 'action' workflow Status +

-**setup-msys2** is a JavaScript GitHub Action (GHA) to setup a full-featured [MSYS2](https://www.msys2.org/) environment, using the GHA [toolkit](https://github.com/actions/toolkit). +[MSYS2](https://www.msys2.org/) is available by default in [windows-latest](https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md#msys2) virtual environment for GitHub Actions. However, the default installation is updated and it includes some pre-installed packages. Moreover, it is neither added to the PATH nor available as a custom `shell` option. -The latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys2.org/distrib/x86_64/) is cached. Using the action extracts it and provides an entrypoint named `msys2do`. +**setup-msys2** is a JavaScript GitHub Action (GHA) to optionally setup a stable [MSYS2](https://www.msys2.org/) environment in a temporal location, using the GHA [toolkit](https://github.com/actions/toolkit); and to provide two custom entrypoints. + +If option `update` is `true`, the default installation is used, in order to reduce startup latency. Otherwise, the latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys2.org/distrib/x86_64/) is downloaded and extracted. ## Usage ```yaml - - uses: numworks/setup-msys2@v1 - - run: msys2do uname -a + - uses: eine/setup-msys2@v1 +``` + +Then, for multi-line scripts: + +```yaml + - shell: msys2 {0} + run: | + uname -a +``` + +Or, for single line commands: + +```yaml + - run: msys2 uname -a ``` +It is also possible to set `msys2` as the default shell. For example: + +```yaml + defaults: + run: + shell: msys2 {0} + steps: + - uses: eine/setup-msys2@v1 + with: + update: true + install: base-devel git + #- run: git config --global core.autocrlf input + # shell: bash + - uses: actions/checkout@v2 + - run: git describe --dirty +``` + +Note that setting `autocrlf` is required in specific use cases only. See [actions/checkout#250](https://github.com/actions/checkout/issues/250). + ### Options #### msystem @@ -24,7 +58,7 @@ The latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys By default, `MSYSTEM` is set to `MINGW64`. However, an optional parameter named `msystem` is supported, which expects `MSYS`, `MINGW64` or `MING32`. For example: ```yaml - - uses: numworks/setup-msys2@v1 + - uses: eine/setup-msys2@v1 with: msystem: MSYS ``` @@ -32,40 +66,53 @@ By default, `MSYSTEM` is set to `MINGW64`. However, an optional parameter named Furthermore, the environment variable can be overriden. This is useful when multiple commands need to be executed in different contexts. For example, in order to build a PKGBUILD file and then test the installed artifact: ```yaml - - uses: numworks/setup-msys2@v1 + - uses: eine/setup-msys2@v1 with: msystem: MSYS - - run: msys2do makepkg-mingw -sCLfc --noconfirm --noprogressbar - - run: msys2do pacman --noconfirm -U mingw-w64-*-any.pkg.tar.xz + - shell: msys2 {0} + run: | + makepkg-mingw -sCLfc --noconfirm --noprogressbar + pacman --noconfirm -U mingw-w64-*-any.pkg.tar.xz - run: | set MSYSTEM=MINGW64 - msys2do + msys2 ``` #### path-type -By default, `MSYS2_PATH_TYPE` is set to `strict` by `msys2do`. It is possible to override it either using an option or setting the environment variable explicitly: +By default, `MSYS2_PATH_TYPE` is set to `strict` by `msys2`. It is possible to override it either using an option or setting the environment variable explicitly: ```yaml - - uses: numworks/setup-msys2@v1 + - uses: eine/setup-msys2@v1 with: path-type: inherit - - run: msys2do + - run: msys2 ``` ```yaml - - uses: numworks/setup-msys2@v1 - - run: msys2do + - uses: eine/setup-msys2@v1 + - run: msys2 env: MSYS2_PATH_TYPE: inherit ``` #### update -By default, the installation is not updated; hence package versions are those of the installation tarball. By setting option `update` to `true`, the action will execute `pacman -Syu --no-confirm`: +By default, the installation is not updated; hence package versions are those of the installation tarball. By setting option `update` to `true`, the action will try to update the runtime and packages cleanly: + +```yaml + - uses: eine/setup-msys2@v1 + with: + update: true +``` + +#### install + +Installing additional packages after updating the system is supported through option `install`. The package or list of packages are intalled through `pacman --noconfirm -S`. ```yaml - - uses: numworks/setup-msys2@v1 + - uses: eine/setup-msys2@v1 with: update: true + install: 'git base-devel' ``` diff --git a/action.yml b/action.yml index 2b14a02..dbb0666 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,5 @@ -name: 'Setup Msys2 environment' -description: 'Setup an Msys2 environment and provide an msys2do helper' -author: 'NumWorks' +name: 'Setup MSYS2 environment' +description: 'Setup an MSYS2 environment' inputs: msystem: description: 'Variant of the environment to set by default: MSYS, MINGW32 or MINGW64' @@ -14,6 +13,10 @@ inputs: description: 'Update MSYS2 installation through pacman' required: false default: false + install: + description: 'Install packages after installation through pacman' + required: false + default: false runs: using: 'node12' main: 'index.js' diff --git a/index.js b/index.js deleted file mode 100644 index 634318a..0000000 --- a/index.js +++ /dev/null @@ -1,49 +0,0 @@ -const core = require('@actions/core'); -const io = require('@actions/io'); -const exec = require('@actions/exec'); -const tc = require('@actions/tool-cache'); -const path = require('path'); -const fs = require('fs'); - -async function run() { - try { - if (process.platform !== 'win32') { - core.setFailed("MSYS2 does not work on non-windows platforms; please check the 'runs-on' field of the job"); - return; - } - - const tmp_dir = process.env['RUNNER_TEMP']; - if (!tmp_dir) { - core.setFailed('environment variable RUNNER_TEMP is undefined'); - return; - } - const dest = path.join(tmp_dir, 'msys'); - - await io.mkdirP(dest); - - const distrib = await tc.downloadTool('http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20190524.tar.xz'); - - await exec.exec('bash', ['-c', `7z x ${distrib.replace(/\\/g, '/')} -so | 7z x -aoa -si -ttar`], {cwd: dest} ); - - let cmd = path.join(dest, 'msys2do.cmd'); - fs.writeFileSync(cmd, [ - 'setlocal', - 'IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=' + core.getInput('path-type'), - `%~dp0\\msys64\\usr\\bin\\bash.exe -ilc "cd $OLDPWD && %*"` - ].join('\r\n')); - - core.addPath(dest); - - core.exportVariable('MSYSTEM', core.getInput('msystem')); - - core.startGroup('Starting MSYS2 for the first time...'); - let pacmanCommand = (core.getInput('update') == 'true') ? ['pacman', '-Syu', '--noconfirm'] : ['uname', '-a']; - await exec.exec('cmd', ['/D', '/S', '/C', cmd].concat(pacmanCommand)); - core.endGroup(); - } - catch (error) { - core.setFailed(error.message); - } -} - -run() diff --git a/main.js b/main.js new file mode 100644 index 0000000..9aa01c3 --- /dev/null +++ b/main.js @@ -0,0 +1,85 @@ +const core = require('@actions/core'); +const io = require('@actions/io'); +const exec = require('@actions/exec'); +const tc = require('@actions/tool-cache'); +const path = require('path'); +const fs = require('fs'); + +async function run() { + try { + if (process.platform !== 'win32') { + core.setFailed("MSYS2 does not work on non-windows platforms; please check the 'runs-on' field of the job"); + return; + } + + const tmp_dir = process.env['RUNNER_TEMP']; + if (!tmp_dir) { + core.setFailed('environment variable RUNNER_TEMP is undefined'); + return; + } + const dest = path.join(tmp_dir, 'msys'); + + await io.mkdirP(dest); + + const update = core.getInput('update') == 'true'; + + let drive = 'C:'; + + if (!update) { + drive = '%~dp0'; + const distrib = await tc.downloadTool('https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.tar.xz'); + await exec.exec('bash', ['-c', `7z x ${distrib.replace(/\\/g, '/')} -so | 7z x -aoa -si -ttar`], {cwd: dest} ); + } + + let wrap = [ + `setlocal`, + `@echo off`, + `IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=` + core.getInput('path-type'), + `set "args=%*"`, + `set "args=%args:\\=/%"`, + drive + `\\msys64\\usr\\bin\\bash.exe --norc -ilceo pipefail "cd $OLDPWD && %args%"` + ].join('\r\n'); + + let cmd = path.join(dest, 'msys2.cmd'); + fs.writeFileSync(cmd, wrap); + + core.addPath(dest); + + core.exportVariable('MSYSTEM', core.getInput('msystem')); + + async function pacman(args) { + await exec.exec('cmd', ['/D', '/S', '/C', cmd, 'pacman', '--noconfirm'].concat(args)); + } + + function changeGroup(str) { + core.endGroup(); + core.startGroup(str); + } + + if (update) { + core.startGroup('Updating packages...'); + await pacman(['-Syuu']); + changeGroup('Killing remaining tasks...'); + await exec.exec('taskkill', ['/F', '/FI', 'MODULES eq msys-2.0.dll']); + changeGroup('Final system upgrade...'); + await pacman(['-Suu']); + core.endGroup(); + } else { + core.startGroup('Starting MSYS2 for the first time...'); + await exec.exec('cmd', ['/D', '/S', '/C', cmd].concat(['uname', '-a'])); + core.endGroup(); + } + + let install = core.getInput('install'); + if (install != '' && install != 'false') { + core.startGroup('Installing additional packages...'); + await pacman(['-S'].concat(install.split(' '))); + core.endGroup(); + } + } + catch (error) { + core.setFailed(error.message); + } +} + +run() diff --git a/package-lock.json b/package-lock.json index 61277c4..fdaf062 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,66 +5,64 @@ "requires": true, "dependencies": { "@actions/core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.0.tgz", - "integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz", + "integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==" }, "@actions/exec": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.2.tgz", - "integrity": "sha512-Yo/wfcFuxbVjAaAfvx3aGLhMEuonOahas2jf8BwyA52IkXTAmLi7YVZTpGAQG/lTxuGoNLg9slTWQD4rr7rMDQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz", + "integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==", "requires": { "@actions/io": "^1.0.1" } }, + "@actions/http-client": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz", + "integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==", + "requires": { + "tunnel": "0.0.6" + } + }, "@actions/io": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz", - "integrity": "sha512-rhq+tfZukbtaus7xyUtwKfuiCRXd1hWSfmJNEpFgBQJ4woqPEpsBw04awicjwz9tyG2/MVhAEMfVn664Cri5zA==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz", + "integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg==" }, "@actions/tool-cache": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.1.2.tgz", - "integrity": "sha512-IJczPaZr02ECa3Lgws/TJEVco9tjOujiQSZbO3dHuXXjhd5vrUtfOgGwhmz3/f97L910OraPZ8SknofUk6RvOQ==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.5.5.tgz", + "integrity": "sha512-y/YO37BOaXzOEHpvoGZDLCwvg6XZWQ7Ala4Np4xzrKD1r48mff+K/GAmzXMejnApU7kgqC6lL/aCKTZDCrhdmw==", "requires": { - "@actions/core": "^1.1.0", - "@actions/exec": "^1.0.1", + "@actions/core": "^1.2.3", + "@actions/exec": "^1.0.0", + "@actions/http-client": "^1.0.8", "@actions/io": "^1.0.1", "semver": "^6.1.0", - "typed-rest-client": "^1.4.0", "uuid": "^3.3.2" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } } }, - "tunnel": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz", - "integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=" + "@zeit/ncc": { + "version": "0.22.3", + "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.3.tgz", + "integrity": "sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ==", + "dev": true }, - "typed-rest-client": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.5.0.tgz", - "integrity": "sha512-DVZRlmsfnTjp6ZJaatcdyvvwYwbWvR4YDNFDqb+qdTxpvaVP99YCpBkA8rxsLtAPjBVoDe4fNsnMIdZTiPuKWg==", - "requires": { - "tunnel": "0.0.4", - "underscore": "1.8.3" - } + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" }, "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" } } } diff --git a/package.json b/package.json index a57fd58..405b896 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,33 @@ { "name": "setup-msys2", "version": "1.0.0", - "description": "Msys2 GitHub action", - "main": "index.js", + "description": "MSYS2 Setup GitHub Action", "repository": { "type": "git", - "url": "git+https://github.com/numworks/setup-msys2.git" + "url": "git+https://github.com/eine/setup-msys2.git" + }, + "scripts": { + "pkg": "ncc build main.js -m -o ./" }, "keywords": [ "GitHub", "Actions", - "Msys2" + "MSYS2", + "MINGW64", + "MINGW32", + "MSYS" ], - "author": "NumWorks", "license": "MIT", "bugs": { - "url": "https://github.com/numworks/setup-msys2/issues" + "url": "https://github.com/eine/setup-msys2/issues" }, - "homepage": "https://github.com/numworks/setup-msys2", + "homepage": "https://github.com/eine/setup-msys2", "dependencies": { - "@actions/core": "^1.2.0", - "@actions/exec": "^1.0.2", - "@actions/tool-cache": "1.1.2" + "@actions/core": "^1.2.4", + "@actions/exec": "^1.0.4", + "@actions/tool-cache": "1.5.5" + }, + "devDependencies": { + "@zeit/ncc": "^0.22.3" } } diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..fbaec16 --- /dev/null +++ b/release.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +set -e + +cd $(dirname $0) + +#npm ci +#npm run build + +if [ "x$1" = "x" ]; then + echo "a release/branch name is required!" + exit 1 +fi + +GIT_USER="$(git config user.name)" +GIT_EMAIL="$(git config user.email)" +GIT_SHA="$(git rev-parse HEAD)" +GIT_ORIGIN="$(git config --get remote.origin.url)" + +mkdir dist +cp README.md action.yml index.js dist +cd dist +git init +git checkout --orphan "$1" +git add . +git config --local user.email "$GIT_EMAIL" +git config --local user.name "$GIT_USER" +git commit -a -m "$1 $GIT_SHA" +git remote add origin "$GIT_ORIGIN" +git push origin +"$1"