Skip to content

Added release workflow #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
create-release-artifacts:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0

- name: Install Taskfile
uses: arduino/actions/setup-taskfile@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Build
run: task dist:all

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist

create-release:
runs-on: ubuntu-latest
needs: create-release-artifacts

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dist
# to ensure compatibility with v1
path: dist

- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: Release ${{ github.ref }}
draft: false

- name: Upload release files on Github
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
tag: ${{ github.ref }}
file_glob: true
#
# - name: Upload release files on Arduino downloads servers
# uses: docker://plugins/s3
# env:
# PLUGIN_SOURCE: "dist/*"
# PLUGIN_TARGET: "/tools/"
# PLUGIN_STRIP_PREFIX: "dist/"
# PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}