Skip to content

Commit

Permalink
Set branch-specific SNAPSHOT version names in non-main snapshot releases
Browse files Browse the repository at this point in the history
  • Loading branch information
RBusarow committed Apr 12, 2024
1 parent e6d4f11 commit abb7b2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set version for non-main branch
if: ${{ github.ref_name != 'main' && !startsWith(github.ref, 'refs/tags/') }}
run: |
echo "ORG_GRADLE_PROJECT_VERION_NAME=${{ github.ref_name }}-SNAPSHOT" | sed 's/\//-/g' >> $GITHUB_ENV
- uses: gradle/wrapper-validation-action@b5418f5a58f5fd2eb486dd7efb368fe7be7eae45 # v2
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
with:
Expand Down
7 changes: 6 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@

# Snapshot Releases

Snapshot releases are automatically created whenever a commit to the `main` branch is pushed.
Snapshot releases are automatically created whenever a commit to the `main` branch is pushed.

For other branches, maintainers can manually trigger a snapshot release from
the [publish-snapshot](https://github.com/square/anvil/actions/workflows/publish-snapshot.yml)
workflow. The version of that snapshot corresponds to the branch name. For example, a branch
named `feature/branch` will have a snapshot version of `feature-branch-SNAPSHOT`.

# Manually uploading a release

Expand Down

0 comments on commit abb7b2b

Please sign in to comment.