2021-01-30 01:12:30 +08:00
|
|
|
name: Create a Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
2022-10-03 18:18:18 +08:00
|
|
|
- '!v*rc*'
|
2021-01-30 01:12:30 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
2022-08-23 00:43:53 +08:00
|
|
|
runs-on: ubuntu-20.04
|
2021-01-30 01:12:30 +08:00
|
|
|
steps:
|
2022-10-14 01:48:20 +08:00
|
|
|
- uses: actions/checkout@v3
|
2021-01-30 01:12:30 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Get the version
|
|
|
|
id: get_version
|
2022-10-14 01:36:42 +08:00
|
|
|
run: |
|
|
|
|
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
2022-10-03 18:54:17 +08:00
|
|
|
echo "TRIMMED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
2021-01-30 01:12:30 +08:00
|
|
|
|
|
|
|
- name: REUSE Compliance Check
|
|
|
|
uses: fsfe/reuse-action@v1
|
|
|
|
with:
|
|
|
|
args: spdx -o zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
|
|
|
|
|
|
|
- name: upload-results
|
2022-08-23 01:14:44 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-30 01:12:30 +08:00
|
|
|
continue-on-error: True
|
|
|
|
with:
|
|
|
|
name: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
|
|
|
path: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
|
|
|
|
2022-10-03 18:29:40 +08:00
|
|
|
- name: Create empty release notes body
|
2021-01-30 01:12:30 +08:00
|
|
|
run: |
|
2022-10-03 18:29:40 +08:00
|
|
|
echo "TODO: add release overview and notes link" > release-notes.txt
|
2021-01-30 01:12:30 +08:00
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
2022-10-03 18:54:17 +08:00
|
|
|
release_name: Zephyr ${{ steps.get_version.outputs.TRIMMED_VERSION }}
|
2021-01-30 01:12:30 +08:00
|
|
|
body_path: release-notes.txt
|
|
|
|
draft: true
|
|
|
|
prerelease: true
|
|
|
|
|
|
|
|
- name: Upload Release Assets
|
|
|
|
id: upload-release-asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
|
|
|
asset_name: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
|
|
|
|
asset_content_type: text/plain
|