Skip to content

Commit

Permalink
fix: move branch back to config files
Browse files Browse the repository at this point in the history
The action input wasn't working.
  • Loading branch information
stdavis committed Apr 5, 2024
1 parent 6bf5ac5 commit a035167
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
51 changes: 21 additions & 30 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ runs:
app-id: ${{ inputs.github-app-id }}
private-key: ${{ inputs.github-app-key }}

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: ⬇️ Set up code
uses: actions/checkout@v4
with:
Expand All @@ -65,7 +60,7 @@ runs:
id: config-file
shell: bash
run: |
echo "Getting release-please config file"
echo "Getting semantic-release config file"
echo "contents=$(cat ${{ github.action_path }}/resources/${{ inputs.release-type }}.releaserc.json | tr -d '[:space:]')" >> $GITHUB_OUTPUT
touch .releaserc.json
Expand All @@ -79,11 +74,6 @@ runs:
id: semantic-release
uses: cycjimmy/[email protected]
with:
branches: |
{
name: "${{ github.ref_name }}",
prerelease: ${{ inputs.prerelease == 'true' }}
}
extra_plugins: |
@semantic-release/changelog
semantic-release-pypi
Expand Down Expand Up @@ -111,23 +101,24 @@ runs:
labels: release
commit-message: "chore: release v${{ steps.semantic-release.outputs.new_release_version }}"

# - name: 🔑 Set git user
# shell: bash
# run: |
# git config user.name "${{ inputs.github-app-name }}"
# git config user.email "${{ inputs.github-app-email }}"
- name: 🔑 Set git user
shell: bash
if: ${{ steps.semantic-release.outputs.new_release_published && inputs.prerelease != 'true' }}
run: |
git config user.name "${{ inputs.github-app-name }}"
git config user.email "${{ inputs.github-app-email }}"
# - name: 🏷️ Tag major and minor versions
# shell: bash
# if: ${{ inputs.create-major-minor-tags == 'true' && steps.release-please.outputs.release_created == 'true' && inputs.prerelease != 'true' }}
# run: |
# echo "deleting existing tags, if any"
# git tag -d v${{ steps.release-please.outputs.major }} || true
# git tag -d v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }} || true
# git push origin :v${{ steps.release-please.outputs.major }} || true
# git push origin :v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }} || true
# echo "creating new tags"
# git tag -a v${{ steps.release-please.outputs.major }} -m "Release v${{ steps.release-please.outputs.major }}"
# git tag -a v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }} -m "Release v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }}"
# git push origin v${{ steps.release-please.outputs.major }}
# git push origin v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }}
- name: 🏷️ Tag major and minor versions
shell: bash
if: ${{ steps.semantic-release.outputs.new_release_published && inputs.create-major-minor-tags == 'true' && inputs.prerelease != 'true' }}
run: |
echo "deleting existing tags, if any"
git tag -d v${{ steps.release-please.outputs.major }} || true
git tag -d v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }} || true
git push origin :v${{ steps.release-please.outputs.major }} || true
git push origin :v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }} || true
echo "creating new tags"
git tag -a v${{ steps.release-please.outputs.major }} -m "Release v${{ steps.release-please.outputs.major }}"
git tag -a v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }} -m "Release v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }}"
git push origin v${{ steps.release-please.outputs.major }}
git push origin v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }}
7 changes: 7 additions & 0 deletions resources/node.releaserc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"branches": [
"main",
{
"name": "dev",
"prerelease": true
}
],
"plugins": [
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
Expand Down
7 changes: 7 additions & 0 deletions resources/python.releaserc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"branches": [
"main",
{
"name": "dev",
"prerelease": true
}
],
"plugins": [
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
Expand Down
7 changes: 7 additions & 0 deletions resources/simple.releaserc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"branches": [
"main",
{
"name": "dev",
"prerelease": true
}
],
"plugins": [
"@semantic-release/release-notes-generator",
"@semantic-release/changelog"
Expand Down

0 comments on commit a035167

Please sign in to comment.