-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
87 additions
and
4,792 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,40 @@ | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
name: Release Creation | ||
|
||
name: Upload Release Assets | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Upload Release Asset | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: | | ||
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
echo ::set-output name=VERSION_NUMBER::${GITHUB_REF/refs\/tags\/v/} | ||
# Substitute the Manifest and Download URLs in the module.json | ||
- name: Substitute Manifest and Download Links For Versioned Ones | ||
id: sub_manifest_link_version | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: 'module.json' | ||
env: | ||
version: ${{github.event.release.tag_name}} | ||
url: https://github.com/${{github.repository}} | ||
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json | ||
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip | ||
|
||
#Substitute the Manifest and Download URLs in the module.json | ||
- name: Substitute Manifest and Download Links For Versioned Ones | ||
id: sub_manifest_link_version | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: 'module.json' | ||
env: | ||
version: ${{ steps.get_version.outputs.VERSION_NUMBER }} | ||
manifest: https://github.com/${{github.repository}}/releases/download/latest/module.json | ||
download: https://github.com/${{github.repository}}/releases/download/${{ steps.get_version.outputs.VERSION }}/furnace.zip | ||
# Create a zip file with all files required by the module to add to the release | ||
- run: zip -r ./module.zip module.json | ||
|
||
- name: Zip files | ||
run: zip -r furnace * -x ".github/*" | ||
|
||
# Create a release for this specific version | ||
- name: Create Release | ||
id: create_version_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.get_version.outputs.VERSION }} | ||
name: Release ${{ steps.get_version.outputs.VERSION }} | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: './module.json,./furnace.zip' | ||
|
||
# Update the 'latest' release | ||
- name: Create Release | ||
id: create_latest_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
name: Latest | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: './module.json,./furnace.zip' | ||
tag: latest | ||
# Create a release for this specific version | ||
- name: Update Release with Files | ||
id: create_version_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true # Set this to false if you want to prevent updating existing releases | ||
name: ${{ github.event.release.name }} | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: './module.json, ./module.zip' | ||
tag: ${{ github.event.release.tag_name }} | ||
body: ${{ github.event.release.body }} |
Oops, something went wrong.