8000 GitHub - skx/github-action-publish-binaries at release-0.9.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Publish binaries when new releases are made.

Notifications You must be signed in to change notification settings

skx/github-action-publish-binaries

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

24 Commits
 
 
 
 
 
 

Repository files navigation

GitHub Action for Uploading Release Artifacts

This repository contains a simple GitHub Action implementation, which allows you to attach binaries to a new (github) release of your repository.

Enabling the action

There are two steps required to use this action:

  • Enable the action inside your repository.
    • This will mean creating a file .github/workflows/release.yml which is where the action is invoked.
    • You'll specify a pattern to describe which binary-artifacts are uploaded.
  • Ensure your binary artifacts are generated.
    • Ideally you should do this in your workflow using another action.
    • But if you're in a hurry you can add a project-specific .github/build script.

Sample Configuration: Preferred

The following configuration file uses this action, along with another to build a project.

This is the preferred approach:

on: release
name: Handle Release
jobs:
  generate:
    name: Create release-artifacts
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Generate artifacts
        uses: skx/github-action-build@master
      - name: Upload artifacts
        uses: skx/github-action-publish-binaries@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          args: 'example-*'

This is the preferred approach because it uses a pair of distinct actions, each having one job:

Sample Configuration: Legacy

In the past this action performed both steps:

  • Generated the artifacts
  • Uploaded the artifacts

That is still possible, but will be removed when actions come out of beta.

For the moment you can continue to work as you did before, add the script .github/build to your repository, and configure this action with a pattern of files to upload.

For example the following usage, defined in .github/workflows/release.yml, uploads files matching the pattern puppet-summary-*.

on: release
name: Handle Release
jobs:
  upload:
    name: Upload Artifacts
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Upload
      uses: skx/github-action-publish-binaries@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        args: 'puppet-summary-*'

We assume that the .github/build script generated suitable binaries. For example a go-based project might create files like this using cross-compilation:

  • puppet-summary-linux-i386
  • puppet-summary-linux-amd64
  • puppet-summary-darwin-i386
  • puppet-summary-darwin-amd64
  • ....

The result should be that those binaries are uploaded shortly after you go to the Github UI and create a new release.

0