<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oyster Lee</title>
    <description>The latest articles on DEV Community by Oyster Lee (@oysterd3).</description>
    <link>https://dev.to/oysterd3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F681700%2F6e4d4b8f-a99e-4b74-8f49-20130ab56799.png</url>
      <title>DEV Community: Oyster Lee</title>
      <link>https://dev.to/oysterd3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oysterd3"/>
    <language>en</language>
    <item>
      <title>How to release built artifacts from one to another repo on GitHub?</title>
      <dc:creator>Oyster Lee</dc:creator>
      <pubDate>Mon, 16 Aug 2021 00:26:13 +0000</pubDate>
      <link>https://dev.to/oysterd3/how-to-release-built-artifacts-from-one-to-another-repo-on-github-3oo5</link>
      <guid>https://dev.to/oysterd3/how-to-release-built-artifacts-from-one-to-another-repo-on-github-3oo5</guid>
      <description>&lt;p&gt;GitHub’s free version package storage is limited at &lt;strong&gt;500MB&lt;/strong&gt; for private repo, and &lt;strong&gt;Unlimited&lt;/strong&gt; for public repo.&lt;/p&gt;

&lt;p&gt;There is a way that you can remain your source code in a private repo, and only release your packages in a public repo. This is how &lt;a href="https://github.com/gathertown/gather-town-desktop-releases" rel="noopener noreferrer"&gt;gathertown&lt;/a&gt; did.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/softprops/action-gh-release" rel="noopener noreferrer"&gt;softprops/action-gh-release&lt;/a&gt; able to achieve that in two lines of code.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 yaml
# workflow.yml
# a lot code at the top
# ...
release:
  steps:
    - name: Release
      uses: softprops/action-gh-release@v1
      with:
        repository: ${{ secrets.owner }}/${{ secrets.repo }}
        token: ${{ secrets.CUSTOM_TOKEN }}



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;By default &lt;code&gt;repository&lt;/code&gt; will be the current repo, and the token will be &lt;code&gt;GITHUB_TOKEN&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;GitHub automatically creates a &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; secret to use in your workflow. You can use the &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; to authenticate in a workflow run.&lt;/p&gt;

&lt;p&gt;When you enable GitHub Actions, GitHub installs a GitHub App on your repository. The &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; secret is a GitHub App installation access token. You can use the installation access token to authenticate on behalf of the GitHub App installed on your repository. The token's permissions are limited to the repository that contains your workflow.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; will not allow you to release the packages to another repo, you need to provide your &lt;strong&gt;personal token&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How can I get Personal Token?
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

GitHub &amp;gt; Setting &amp;gt; Developer settings &amp;gt; Personal access tokens &amp;gt; repo scope


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;or you can access it via the &lt;a href="https://github.com/settings/tokens" rel="noopener noreferrer"&gt;direct link&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxj8wrssq556khmtaxay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdxj8wrssq556khmtaxay.png" alt="1_IM5JwEXCIGGwVoW_bEhgBg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Publishing to another &lt;code&gt;repo&lt;/code&gt; only require repo scope. Remember to copy-paste it somewhere after you got the token because you will not able to retrieve it for a second time.&lt;/p&gt;

&lt;p&gt;Now create secrets in your repo&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

https://github.com/[OWNER]/[REPO]/settings/secrets/actions


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can put any name you like, but make sure to change &lt;code&gt;token: ${{ secret.THE_NAME_YOU_PUT }}&lt;/code&gt; in the workflow script&lt;/p&gt;

</description>
      <category>github</category>
      <category>githubactions</category>
      <category>cicd</category>
      <category>workflow</category>
    </item>
  </channel>
</rss>
