fork/glide

git clone https://git.julia.blue/fork/glide

Tyler Mandrychore: Automate releases with release-pleaseb1acaa9

v0.1.1
2.9 KiB77 linesraw
1# Automate releases with Release Please.
2# https://github.com/googleapis/release-please#release-please
3
4on:
5  push:
6    branches:
7      - main
8
9permissions:
10  contents: write
11  issues: write
12  pull-requests: write
13
14name: release-please
15
16jobs:
17  release-please:
18    runs-on: ubuntu-latest
19    steps:
20      # Create releases for merged release PRs.
21      - name: Create releases for merged release PRs
22        uses: googleapis/release-please-action@v4
23        id: release
24        with:
25          # Note: We use the default github token here because it doesn't
26          # actually do any workflow-triggering actions. The triggering step is
27          # the tag, below.
28          target-branch: main
29          skip-github-pull-request: true
30
31      # Ensure that a tag is created, even if the release is created as a draft.
32      # This works around https://github.com/googleapis/release-please-action/issues/962.
33      # It also triggers the package action, which will publish the release when finished.
34      - uses: actions/checkout@v4
35        with:
36          # Use a custom access token so downstream actions are triggered.
37          token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
38      - name: tag release
39        if: ${{ steps.release.outputs.release_created }}
40        run: |
41          git config user.name github-actions[bot]
42          git config user.email github-actions[bot]@users.noreply.github.com
43          git tag -d ${{ steps.release.outputs.tag_name }} || true
44          git tag -a ${{ steps.release.outputs.tag_name }} -m "Release ${{ steps.release.outputs.tag_name }}"
45          git push origin ${{ steps.release.outputs.tag_name }}
46
47      # Add a comment with a durable link instead of the temporary unpublished one.
48      - name: Find merged PR
49        # release-please doesn't give us PR info even though the docs say it
50        # will on release creation.
51        if: steps.release.outputs.release_created
52        uses: jwalton/gh-find-current-pr@master
53        id: pr
54        with:
55          state: closed
56      - name: Comment on merged PR
57        if: steps.release.outputs.release_created && steps.pr.outputs.number
58        uses: actions/github-script@v7
59        with:
60          script: |
61            const prNumber = ${{ steps.pr.outputs.number }};
62            github.rest.issues.createComment({
63              owner: context.repo.owner,
64              repo: context.repo.repo,
65              issue_number: prNumber,
66              body: `Packaging action triggered. Release will be available here when complete:
67
68              ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ steps.release.outputs.tag_name }}`
69            });
70
71      - name: Create release PRs for new commits on main
72        uses: googleapis/release-please-action@v4
73        with:
74          # Use a custom access token so pull request actions are triggered.
75          token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
76          target-branch: main
77          skip-github-release: true