Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Update example release.yml in GitHub Actions documentation #59

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

afhoffman
Copy link

I've just made a few changes here:

  1. The Build and Package steps have been separated in line with the discussion linked in the documentation.

  2. GitHub has deprecated the set-output command. I updated that call on line 39 in the new version to use an environment file.

  3. actions/upload-release-asset is no longer maintained. The ReadMe in the repo for that action suggests using softprops/action-gh-release instead which does shorten the code up quite a bit as it allows uploading all assets in one action rather than one action per asset.

I have this pipeline live in my fork of dethau's workflow-experiments repo.

@marcusolsson
Copy link
Owner

Thank you for this! Didn't realize it had changed. I'll review this ASAP

@andymac4182
Copy link

Just tried this one and still getting warnings on the Release step.

@afhoffman
Copy link
Author

Just tried this one and still getting warnings on the Release step.

You're right. Those deprecation warnings are coming from softprops/action-gh-release. There's a PR to fix the warnings on that repo, but maintenance doesn't seem to be very active over there.

This PR has some discussion on the same issue. One of the users in that thread recommends using ncipollo/release-action instead. It looks like a promising alternative.

When I get a chance, I'll try out ncipollo/release-action and make a push back to this PR if it works well.

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is this necessary? I haven't seen any issues leaving this out.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're totally right, I don't think this is needed either. Will remove fetch-depth in the next commit.

docs/publishing/release-your-plugin-with-github-actions.md Outdated Show resolved Hide resolved
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
fetch-depth: 0 # Otherwise, pushing refs to destination repository fails.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, but I'll remove this line in response to this conversation.

docs/publishing/release-your-plugin-with-github-actions.md Outdated Show resolved Hide resolved
- name: Package
run: |
mkdir ${{ github.event.repository.name }}
cp main.js manifest.json styles.css README.md ${{ github.event.repository.name }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cp main.js manifest.json styles.css README.md ${{ github.event.repository.name }}
cp main.js manifest.json styles.css README.md ${{ github.event.repository.name }}

This assumes that the developer uses the plugin id as the repository name. To be honest, I'm not sure whether Obsidian cares about the zip file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think Obsidian cares about the zip file, either. I do think it's convenient to have it if someone wants to download the compiled artifacts and not the .zip of the source tree that GitHub gives by default.

I like the way that advanced-tables is doing it -- the plugin name is set in the env block toward the top.

I will push a commit in the near future which fixes this and several other things mentioned above.

afhoffman and others added 2 commits October 29, 2022 21:42
Change `node-version` to current LTS (18.x).

Co-authored-by: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com>
Remove unneeded `--if-present` in `build` section.

Co-authored-by: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com>
@alexevanczuk
Copy link

@afhoffman
I saw this pop up referencing the other PR. Also wanted to plug just using the vanilla gh CLI client in your CD for releases.

I switched over to use that. Here's an example https://github.com/rubyatscale/use_packwerk/blob/main/.github/workflows/cd.yml

@andymac4182
Copy link

Any updates on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants