Merge remote-tracking branch 'origin/main' #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Please PreRelease Test | |
on: | |
push: | |
branches: | |
- main | |
- prerelease | |
jobs: | |
release-please: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
outputs: | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
release_created: ${{ steps.release.outputs.release_created }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref_name }} | |
fetch-depth: 0 | |
- name: Configure Release-Please for Branch | |
run: | | |
if [[ "${{ github.ref_name }}" == "prerelease" ]]; then | |
echo "Configuring for pre-releases..." | |
cp prerelease-config.json release-please-config.json | |
fi | |
- name: Run Release-Please | |
id: release | |
uses: googleapis/release-please-action@v4 | |
with: | |
target-branch: ${{ github.ref_name }} | |
- name: Create Release Asset | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
RELEASE_TAG=${{ steps.release.outputs.tag_name }} | |
git archive --format=zip --output="${RELEASE_TAG}.zip" HEAD | |
gh release upload ${RELEASE_TAG} "${RELEASE_TAG}.zip" --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cleanup | |
if: always() | |
run: | | |
if [[ "${{ github.ref_name }}" == "prerelease" ]]; then | |
git checkout -- release-please-config.json || true | |
fi |