Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip action replacement step if the env is specified #25

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# @open-sauced/release

> [**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish to `npm` and/or `ghcr`.
> now with alpha and beta pre-releases
> now with alpha and beta pre-releases

[![Commits](https://img.shields.io/github/commit-activity/w/open-sauced/release?style=flat)](https://github.com/open-sauced/release/pulse)
[![Issues](https://img.shields.io/github/issues/open-sauced/release.svg?style=flat)](https://github.com/open-sauced/release/issues)
Expand Down Expand Up @@ -34,13 +34,15 @@ This shareable configuration use the following plugins:
## πŸ–₯️ Requirements

Most important limitations are:

- `GITHUB_TOKEN` for everything
- `NPM_TOKEN` for public `npm` library
- `docker` containers need to be built beforehand

You can skip here if you are using elevated [Private Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), however we don't recommend going down that path.

No force push or admin cherries branch protections for the following branches:

- `main` - required
- `alpha` - optional, pre-release branch
- `beta` - optional, pre-release branch
Expand All @@ -52,7 +54,7 @@ If you use more than the main branch, optionally create an environment that is l

We are using `production` in our examples, if you copy paste them you will find this new environment generated in your settings! πŸ•

## πŸ§ͺ GitHub actions usage
## πŸ§ͺ GitHub actions usage

Since version 3 it is possible to use semantic-release without any trace of it or the open-sauced configuration anywhere in the dependency tree.

Expand Down Expand Up @@ -91,7 +93,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: '♻️ cleanup'
- name: "♻️ cleanup"
run: |
echo ${{ env.RELEASE_TAG }}
echo ${{ env.RELEASE_VERSION }}
Expand Down Expand Up @@ -132,7 +134,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: '♻️ cleanup'
- name: "♻️ cleanup"
run: |
echo ${{ steps.semantic-release.outputs.release-tag }}
echo ${{ steps.semantic-release.outputs.release-version }}
Expand Down Expand Up @@ -164,7 +166,9 @@ npx semantic-release

If you do not plan to publish to `npm` _or_ `ghcr` but still want to cut tags
and GitHub releases with this system, you can specify `SKIP_NPM_PUBLISH` and
`SKIP_DOCKER_PUBLISH`. This will still publish releases, generate semver tags,
`SKIP_DOCKER_PUBLISH`. Also, if you want to set up this action in a Github Action repo and do not plan on using Docker, you can specify `SKIP_ACTION_REPLACEMENT` to skip the action replacement step.

This will still publish releases, generate semver tags,
and generate GitHub release notes. But it will skip attempting to publish

Then, in a separate GitHub action, you can watch for the releases and upload assets
Expand Down Expand Up @@ -200,7 +204,7 @@ jobs:
uses: open-sauced/release@v2

outputs:
release-tag: ${{ steps.semantic-release.outputs.release-tag }}
release-tag: ${{ steps.semantic-release.outputs.release-tag }}

build:
needs:
Expand All @@ -210,20 +214,20 @@ jobs:
contents: write # release changes require contents write

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Check out code
uses: actions/checkout@v3

- name: Build and upload Go binaries
env:
GH_TOKEN: ${{ github.token }}
run: |
go build -o build/my-go-binary
gh release upload ${{ needs.release.outputs.release-tag }} build/my-go-binary
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Check out code
uses: actions/checkout@v3

- name: Build and upload Go binaries
env:
GH_TOKEN: ${{ github.token }}
run: |
go build -o build/my-go-binary
gh release upload ${{ needs.release.outputs.release-tag }} build/my-go-binary
```

## πŸ”§ Configuration
Expand Down Expand Up @@ -254,7 +258,7 @@ If you have a `manifest.json` present, our config will attempt to adjust the `ve

### Docker

Unless you have a `Dockerfile` present in your root folder, this module is not added to the release config.
Unless you have a `Dockerfile` present in your root folder, this module is not added to the release config.

If you have a `Dockerfile` present, our config will attempt to push to `ghcr.io`.

Expand Down
Loading
Loading