fix do plugin #55
Workflow file for this run
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
on: | |
push: | |
tags: | |
- "v*" | |
name: Upload Release Asset | |
jobs: | |
build: | |
name: Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Enable Corepack | |
run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'yarn' | |
- name: Build project | |
run: | | |
yarn install --immutable-cache --check-cache && \ | |
yarn build && \ | |
yarn build -c build:update | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload plugin-all | |
id: upload-release-asset-yarn-plugin-all | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .yarn/plugins/@ojkelly/plugin-all.cjs | |
asset_name: "plugin-all.cjs" | |
asset_content_type: text/javascript | |
- name: Upload plugin-build | |
id: upload-release-asset-yarn-plugin-build | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .yarn/plugins/@ojkelly/plugin-build.cjs | |
asset_name: "plugin-build.cjs" | |
asset_content_type: text/javascript | |
- name: Upload plugin-bundle | |
id: upload-release-asset-yarn-plugin-bundle | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .yarn/plugins/@ojkelly/plugin-bundle.cjs | |
asset_name: "plugin-bundle.cjs" | |
asset_content_type: text/javascript | |
- name: Upload plugin-test | |
id: upload-release-asset-yarn-plugin-test | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .yarn/plugins/@ojkelly/plugin-test.cjs | |
asset_name: "plugin-test.cjs" | |
asset_content_type: text/javascript | |
- name: Upload package-yaml | |
id: upload-release-asset-package-yaml | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .yarn/plugins/@ojkelly/plugin-package-yaml.cjs | |
asset_name: "plugin-package-yaml.cjs" | |
asset_content_type: text/javascript | |
- name: Update release redirects | |
run: | | |
export TAGNAME=$(echo "${{ github.ref }}" | sed 's|refs/tags/||g') | |
sed -i'' "4s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-all.cjs\"|" netlify.toml | |
sed -i'' "10s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-build.cjs\"|" netlify.toml | |
sed -i'' "16s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-build.cjs\"|" netlify.toml | |
sed -i'' "22s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-bundle.cjs\"|" netlify.toml | |
sed -i'' "28s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-bundle.cjs\"|" netlify.toml | |
sed -i'' "34s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-test.cjs\"|" netlify.toml | |
sed -i'' "40s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-test.cjs\"|" netlify.toml | |
sed -i'' "54s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-package-yaml.cjs\"|" netlify.toml | |
# Commit new version | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: Update release version to ${{ github.ref }} | |
committer: GitHub <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
signoff: false | |
branch: update-release-version | |
delete-branch: true | |
title: "release: Update release version to ${{ github.ref }}" | |
base: main | |
labels: | | |
report | |
automated pr | |
assignees: ojkelly | |
reviewers: ojkelly | |
team-reviewers: | | |
owners | |
maintainers | |
draft: false |