switched from Docker to JS action

This commit is contained in:
melody-universe 2021-08-07 14:19:59 -07:00
parent 96aaf80c13
commit 920f85e18e
3 changed files with 29 additions and 42 deletions

View File

@ -6,9 +6,35 @@ on:
- 'master' - 'master'
jobs: jobs:
commit-dependencies:
name: 'Commit dependencies'
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v2'
with:
ref: ${{ github.ref }}
- name: 'Setup Node.js'
uses: 'actions/setup-node@v1'
with:
node-version: 12
- name: 'commit dependencies'
run: |
npm ci --production
git config user.name "Automated Version Bump"
git config user.email "gh-action-bump-version@users.noreply.github.com"
git add node_modules -f
if [ $(git status --porcelain=v1 2>/dev/null | wc -l) -gt 0 ]
then
git commit -m "ci: commit dependencies"
git push
fi
bump-version: bump-version:
name: 'Bump Version on master' name: 'Bump Version on master'
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: commit-dependencies
steps: steps:
- name: 'Checkout source code' - name: 'Checkout source code'
@ -17,13 +43,9 @@ jobs:
ref: ${{ github.ref }} ref: ${{ github.ref }}
- name: 'cat package.json' - name: 'cat package.json'
run: cat ./package.json run: cat ./package.json
- name: 'Setup Node.js'
uses: 'actions/setup-node@v1'
with:
node-version: 12
- name: 'Automated Version Bump' - name: 'Automated Version Bump'
id: version-bump id: version-bump
uses: 'phips28/gh-action-bump-version@master' uses: 'melody-universe/gh-action-bump-version@master'
with: with:
tag-prefix: 'v' tag-prefix: 'v'
env: env:

View File

@ -1,35 +0,0 @@
# Use the latest version of Node.js
#
# You may prefer the full image:
# FROM node
#
# or even an alpine image (a smaller, faster, less-feature-complete image):
# FROM node:alpine
#
# You can specify a version:
# FROM node:10-slim
FROM node:15.12.0-slim
# Labels for GitHub to read your action
LABEL "com.github.actions.name"="Automated version bump for npm packages."
LABEL "com.github.actions.description"="Automated version bump for npm packages."
# Here are all of the available icons: https://feathericons.com/
LABEL "com.github.actions.icon"="chevron-up"
# And all of the available colors: https://developer.github.com/actions/creating-github-actions/creating-a-docker-container/#label
LABEL "com.github.actions.color"="blue"
# Copy the package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN apt-get update
RUN apt-get -y install git
RUN npm ci --only=production
# Copy the rest of your action's code
COPY . .
# Run `node /index.js`
ENTRYPOINT ["node", "/index.js"]

View File

@ -1,8 +1,8 @@
name: Automated Version Bump name: Automated Version Bump
description: Automated version bump for npm packages. description: Automated version bump for npm packages.
runs: runs:
using: docker using: node12
image: Dockerfile main: index.js
branding: branding:
icon: chevron-up icon: chevron-up
color: blue color: blue