Skip to content

A GitHub Action for publishing the artifacts to GitHub Releases and code packages to the package repositories

License

Notifications You must be signed in to change notification settings

Reloaded-Project/devops-publish-action

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

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Reloaded Publish Action

License

This GitHub Action is designed to streamline the publishing process for Reloaded projects by automatically detecting and uploading artifacts to the appropriate locations, such as GitHub Releases, NuGet, and crates.io.

Features

  • 📦 Download artifacts generated by other GitHub Actions
  • 🚀 Upload artifacts to GitHub Releases
  • 📦 Publish NuGet packages to nuget.org
  • 🦀 Publish Rust packages to crates.io
  • 🔍 Automatically detect and upload the appropriate artifacts

Usage

To use this action in your GitHub workflow, add the following step:

publish-crate:
  permissions:
    contents: write

  # Dependencies that produce publish-able artifacts.
  needs: [build-and-test,build-c-headers,build-dotnet-library]

  # Publish only on tags
  if: startsWith(github.ref, 'refs/tags/') 
  runs-on: ubuntu-latest
  steps:
  - uses: actions/checkout@v4

  - name: Publish artifacts
    uses: Reloaded-Project/devops-publish-action@v1
    with:
      nuget-api-key: ${{ secrets.NUGET_KEY }}
      crates-io-token: ${{ secrets.CRATES_IO_TOKEN }}
      
      # For standalone Rust projects, specify paths to the project directories
      rust-project-paths: |
        ./path/to/rust/project1
        ./path/to/rust/project2
        
      # For Cargo workspace projects, specify the project names (not paths)
      cargo-workspace-projects: |
        project_name1
        project_name2

Inputs

Input Description Required Default
nuget-api-key NuGet API key for publishing packages No
crates-io-token Crates.io token for publishing Rust packages No
rust-project-paths List of paths to standalone Rust projects No ``
cargo-workspace-projects List of specific projects to publish from a Cargo workspace No ''
artifacts-directory Path to the directory containing the artifacts No artifacts
compressed-artifacts-directory Path to the directory containing the zipped artifacts No compressed-artifacts
additional-publish-params Additional parameters for cargo publish No ''
create-release Whether the artifacts should be uploaded to GitHub Releases No true
checkout-current-repo Checks out the current repository. No true

How this Action Works

  • Downloads all artifacts and re-uploads them to the GitHub Releases.
  • Uploads all NuGet packages stored in artifacts to nuget.org
  • Uploads specified Rust projects to crates.io using two different methods:
    • Standalone Projects: Uses --manifest-path to publish projects at specific file paths (via rust-project-paths)
    • Workspace Projects: Uses -p flag to publish specific projects within a workspace by name (via cargo-workspace-projects)

Why this Action Exists

Reloaded projects produce various types of artifacts, such as binaries, libraries, NuGet packages, and Rust packages. This action makes it easy to publish these artifacts.

This action is designed to be used in conjunction with actions such as:

This action centralizes the publishing logic, ensuring consistency across projects and reducing maintenance overhead.

Contributing

Contributions are welcome!

If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request in this repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A GitHub Action for publishing the artifacts to GitHub Releases and code packages to the package repositories

Resources

License

Stars

Watchers

Forks

Packages

No packages published