-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
cc8e40e
commit f601ded
Showing
2 changed files
with
29 additions
and
60 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 |
---|---|---|
|
@@ -10,7 +10,8 @@ env: | |
NIM_VERSION: 'stable' | ||
MAINTAINER: 'Marcus Ramberg <[email protected]>' | ||
RELEASE_FILES: promexplorer LICENSE README.* | ||
|
||
permissions: | ||
contents: write | ||
jobs: | ||
build-artifact: | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -22,13 +23,25 @@ jobs: | |
- macOS-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Cache choosenim | ||
id: cache-choosenim | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.choosenim | ||
key: ${{ runner.os }}-choosenim-${{ env.NIM_VERSION }} | ||
- name: Cache nimble | ||
id: cache-nimble | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.nimble | ||
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} | ||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: ${{ env.NIM_VERSION }} | ||
- run: nimble build -Y -d:release | ||
- name: Create artifact | ||
run: | | ||
assets="${{ env.APP_NAME }}_$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')" | ||
assets="${{ env.APP_NAME }}-${RUNNER_OS}-${GITHUB_REF_NAME}" | ||
echo "$assets" | ||
mkdir -p "dist/$assets" | ||
cp -r ${{ env.RELEASE_FILES }} "dist/$assets/" | ||
|
@@ -42,9 +55,9 @@ jobs: | |
ls -lah *.* | ||
) | ||
shell: bash | ||
- uses: actions/upload-artifact@v3.1.2 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifact-${{ matrix.os }} | ||
name: ${{ ENV.APP_NAME}}-${{runner.os}} | ||
path: | | ||
dist/*.tar.gz | ||
dist/*.zip | ||
|
@@ -54,62 +67,18 @@ jobs: | |
needs: | ||
- build-artifact | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Create 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 | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Write upload_url to file | ||
run: echo '${{ steps.create-release.outputs.upload_url }}' > upload_url.txt | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: create-release | ||
path: upload_url.txt | ||
|
||
upload-release: | ||
runs-on: ubuntu-latest | ||
needs: create-release | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
asset_name_suffix: linux.tar.gz | ||
asset_content_type: application/gzip | ||
- os: windows-latest | ||
asset_name_suffix: windows.zip | ||
asset_content_type: application/zip | ||
- os: macOS-latest | ||
asset_name_suffix: macos.tar.gz | ||
asset_content_type: application/gzip | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact-${{ matrix.os }} | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: create-release | ||
|
||
- id: vars | ||
- name: What did we get? | ||
run: | | ||
echo "::set-output name=upload_url::$(cat upload_url.txt)" | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
ls -la * */* | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
promexplorer-*/*.tar.gz | ||
promexplorer-*/*.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.vars.outputs.upload_url }} | ||
asset_path: ${{ env.APP_NAME }}_${{ matrix.asset_name_suffix }} | ||
asset_name: ${{ env.APP_NAME }}_${{ matrix.asset_name_suffix }} | ||
asset_content_type: ${{ matrix.asset_content_type }} |
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