-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish automation of github releases
- Loading branch information
1 parent
bcb69ed
commit 3f6cd9c
Showing
5 changed files
with
1,988 additions
and
24 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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Thunderstore Bundle | |
|
||
on: | ||
workflow_dispatch: | ||
branches: [master] | ||
branches: [test-automatic-release] | ||
|
||
jobs: | ||
build: | ||
|
@@ -15,39 +15,56 @@ jobs: | |
|
||
steps: | ||
- name: Set NEBULA_PATH environmental variable | ||
id: nebula-path | ||
run: > | ||
echo "NEBULA_PATH=${{ env.PLUGIN_PATH }}${{ env.NEBULA_FOLDER }}" >> $GITHUB_ENV | ||
echo "::set-output name=PATH::${{ env.PLUGIN_PATH }}${{ env.NEBULA_FOLDER }}" | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 # can't shallowly clone due to git versioning | ||
- run: | | ||
git config user.name '${{ github.actor }}' | ||
git config user.email '${{ github.actor }}@users.noreply.github.com' | ||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
- name: Prepare Release | ||
run: > | ||
$version = nbgv prepare-release --format json; > | ||
echo "PREPARE_RELEASE_OUTPUT=$version" >> $GITHUB_ENV | ||
- uses: actions/setup-node@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14" | ||
cache: 'npm' | ||
- run: npm install @terascope/fetch-github-release | ||
- run: npm install json2toml | ||
- run: npm install xml-reader | ||
- run: npm install xml-query | ||
- run: npm install zip-a-folder | ||
- run: npm install fs-extra | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: npm-${{ hashFiles('package-lock.json') }} | ||
restore-keys: npm- | ||
|
||
- name: Install dependencies | ||
run: npm ci --ignore-scripts | ||
|
||
- name: Clear output directory in DSP files | ||
# We use SilentlyContinue here because it errors out if the folder does not exist otherwise | ||
run : rm -R -ErrorAction SilentlyContinue "${{ env.NEBULA_PATH }}" | ||
run : rm -R -ErrorAction SilentlyContinue "${{ steps.nebula-path.outputs.PATH }}" | ||
|
||
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
# Add dotnet to the PATH: https://github.com/actions/setup-dotnet | ||
- name: Setup dotnet.exe | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: "3.1.x" | ||
- run: | | ||
dotnet tool install --tool-path . nbgv | ||
# Build it | ||
- name: Build the application | ||
run: msbuild $env:SOLUTION_NAME /p:Configuration=Release /p:PublicRelease=true | ||
|
@@ -58,10 +75,25 @@ jobs: | |
TSTORE_TOKEN: ${{ secrets.TSTORE_TOKEN }} | ||
run: node .github\scripts\thunderstore_bundle.js | ||
|
||
- name: Prepare Release | ||
id: prepare-release | ||
run: | | ||
$version = ./nbgv prepare-release --format json; | ||
echo "::set-output name=PREPARE_RELEASE_OUTPUT::$version"; | ||
- name: Push changes | ||
run: | | ||
git push; | ||
git checkout ${{ fromJson(steps.prepare-release.outputs.PREPARE_RELEASE_OUTPUT).NewBranch.Name }}; | ||
git push -u origin head; | ||
git checkout ${{ fromJson(steps.prepare-release.outputs.PREPARE_RELEASE_OUTPUT).CurrentBranch.Name }} | ||
# Create release | ||
- uses: ncipollo/release-action@v1.8.6 | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: dist\release\Nebula_${{ fromJson(env.PREPARE_RELEASE_OUTPUT).NewBranch.Version }}.zip | ||
tag: ${{ fromJson(env.PREPARE_RELEASE_OUTPUT).NewBranch.Name }} | ||
commit: ${{ fromJson(env.PREPARE_RELEASE_OUTPUT).NewBranch.Commit }} | ||
artifactErrorsFailBuild: true | ||
bodyFile: "dist\\release\\BODY.md" | ||
artifacts: "dist\\release\\Nebula_${{ fromJson(steps.prepare-release.outputs.PREPARE_RELEASE_OUTPUT).NewBranch.Version }}.zip" | ||
tag: ${{ fromJson(steps.prepare-release.outputs.PREPARE_RELEASE_OUTPUT).NewBranch.Name }} | ||
commit: ${{ fromJson(steps.prepare-release.outputs.PREPARE_RELEASE_OUTPUT).NewBranch.Name }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
Oops, something went wrong.