Skip to content

cdqag/action-release-to-branch

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

release-to-branch

This action has been created to automate the process of releasing (copying) selected files/directories to a specific branch. It was designed mainly for releasing custom GitHub Actions - especially those that must build/process some files before they can be used. Eg. TypeScript files that must be compiled to JavaScript.

Usage

- name: Release to major version branch
  uses: cdqag/action-release-to-branch@v1
  with:
    branch: my-branch
    dirs: "dist"

Inputs

  • branch Required

    Destination branch. Can be for example v1.

  • dirs Default: 'src'

    Space-separated list of directories to release

  • files Default: 'action.ya?ml LICENSE README.md'

    Space-separated list of files (may be regexp) to be copied

  • exclude Default: ''

    Space-separated list of names to exclude (note: .git is always excluded)

Outputs

None

Example

An example of a workflow that builds a JS project and releases it to a branch with a major version number.

name: 📦 Release

on:
  workflow_dispatch:
    inputs:
      version:
        type: string
        description: 'Version to release (eg. 1.2.3 or v1.2.3)'
        required: true

jobs:
  release:
    runs-on: ubuntu-latest

    steps:
      - name: Normalize version
        id: version
        uses: cdqag/action-normalize-version@v1
        with:
          version: ${{ inputs.version }}

      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version-file: '.nvmrc'

      - name: Install dependencies
        run: npm ci

      - name: Build
        run: npm run build

      - name: Configure git user
        uses: snow-actions/git-config-user@v1.0.0
        with:
          name: github-actions[bot]
          email: github-actions[bot]@users.noreply.github.com

      - name: Release dist to major version branch
        uses: cdqag/action-release-to-branch@v1
        with:
          branch: ${{ steps.version.outputs.major }}
          dirs: dist

      - name: Release
        uses: ncipollo/release-action@v1
        with:
          token: ${{ github.token }}
          commit: refs/heads/${{ steps.version.outputs.major }}
          tag: ${{ steps.version.outputs.semver }}

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

About

GitHub Action that releases files to the branch

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages