Skip to content

Commit

Permalink
adding releasr for nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Dec 15, 2022
0 parents commit 4d6804e
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Container image that runs your code
FROM ghcr.io/packagrio/packagr:latest-node

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 PackagrIO

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.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# action-releasr-go

<p align="center">
<a href="https://github.com/PackagrIO/docs">
<img width="300" alt="portfolio_view" src="https://github.com/PackagrIO/releasr/raw/master/images/releasr.png">
</a>
</p>

Github Action that allows you to commit local changes & tag Go repositories

# Documentation
Full documentation is available at [PackagrIO/docs](https://github.com/PackagrIO/docs)

# Usage

```yaml
name: Release
jobs:
build:
name: Build
runs-on: ubuntu-latest
container: ghcr.io/packagrio/packagr-dev:master
env:
PROJECT_PATH: /go/src/github.com/packagrio/publishr
steps:
# Fetch depth 0 is required for committing changes
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
# ... do your compile, testing, bumpr, etc steps here.
- name: Commit Changes
id: commit
uses: packagrio/action-releasr-node@master
env:
# This is necessary in order to push a commit to the repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged

# ... do your publishr steps here.

```

# Inputs

# Outputs
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version := "1.0.0"
30 changes: 30 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Node Releasr'
description: 'Github Action that allows you to commit local changes & tag Node repositories'
inputs:
version_metadata_path:
description: 'Path to file containing Version string'
required: true
default: 'package.json'
author_name:
description: 'Commit Author'
required: true
default: 'packagrio-bot'
author_email:
description: 'Commit Author Email'
required: true
default: 'packagr-io[bot]@users.noreply.github.com'
cwd:
description: 'Working Directory'
required: false
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
env:
PACKAGR_VERSION_METADATA_PATH: ${{ inputs.version_metadata_path }}
PACKAGR_ENGINE_GIT_AUTHOR_NAME: ${{ inputs.author_name }}
PACKAGR_ENGINE_GIT_AUTHOR_EMAIL: ${{ inputs.author_email }}
CUSTOM_WORKING_DIRECTORY: ${{ inputs.cwd }}
branding:
icon: 'tag'
color: 'blue'
21 changes: 21 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

PATH=/srv/packagr:$PATH

# retrieve the latest releasr binary
asset_url=$(curl -s https://api.github.com/repos/PackagrIO/releasr/releases/latest \
| grep browser_download_url | grep 'packagr-releasr-linux-amd64' | cut -d '"' -f 4)

# download the releasr asset here.
curl -L -o /srv/packagr/packagr-releasr $asset_url

# make releasr executable
chmod +x /srv/packagr/packagr-releasr

if [[ ! -z "${CUSTOM_WORKING_DIRECTORY}" ]]; then
echo "using custom dir: ${CUSTOM_WORKING_DIRECTORY}"
cd "${CUSTOM_WORKING_DIRECTORY}"
fi

echo "Starting Releasr $1"
packagr-releasr start --scm github --package_type node

0 comments on commit 4d6804e

Please sign in to comment.