This repository has been archived by the owner on May 6, 2024. It is now read-only.
fix(workflows) #100
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will install Deno then run `deno lint` and `deno test`. | |
# For more information see: https://github.com/denoland/setup-deno | |
name: Deno | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repo | |
uses: actions/checkout@v3 | |
- name: Set up Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Bundle with Deno | |
run: deno task bundle | |
- name: Rename and Upload App.js files | |
run: | | |
cd dist | |
for folder in */; do | |
folder=${folder%*/} | |
if [ "$folder" != "snippets" ]; then | |
mv "${folder}/app.js" "${folder}/${folder}.app.js" | |
fi | |
done | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.sha }} | |
release_name: Release ${{ github.sha }} | |
draft: false | |
prerelease: false | |
- name: Upload Assets | |
id: upload_assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: | | |
dist/**/*.app.js | |
asset_name: | | |
${{ github.event.head_commit.committer.username }}-${{ github.sha }}-${{ github.event.repository.name }}-$1 | |
asset_content_type: application/javascript |