From 83bf7294af94a7ae4a33833f8843feb59c038d3e Mon Sep 17 00:00:00 2001 From: Gianni Chiappetta Date: Tue, 28 Sep 2021 15:12:21 -0400 Subject: [PATCH] fix: rename release workflow --- .github/workflows/build.yml | 120 ---------------------------------- .github/workflows/release.yml | 8 ++- 2 files changed, 7 insertions(+), 121 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 9e1e2c5..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: Build - -on: - push: - branches: - - "!*" - tags: - - "v*" - -jobs: - build: - strategy: - matrix: - include: - - name: Linux x86_64 - os: ubuntu-latest - arch: x64 - target: x86_64-unknown-linux-gnu - - name: MacOS arm64 - os: macos-11 - arch: arm64 - target: aarch64-apple-darwin - - name: MacOS x86_64 - os: macos-11 - arch: x64 - target: x86_64-apple-darwin - - name: Windows x86_64 - os: windows-latest - arch: x64 - target: x86_64-pc-windows-msvc - name: Build for ${{ matrix.name }} - runs-on: ${{ matrix.os }} - env: - SANDBOX_SKIP_DOWNLOAD: true - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: true - - name: Get version tag - uses: olegtarasov/get-tag@v2.1 - id: tag - - name: Get artifact name - id: artifact_name - run: | - echo "::set-output name=value::sandbox-${{ steps.tag.outputs.tag }}-${{ matrix.target }}" - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: '16' - cache: 'npm' - - name: Build library - run: | - npm install - npx cargo-cp-artifact -a cdylib sandbox ${{ steps.artifact_name.outputs.value }} -- cargo build --message-format=json-render-diagnostics --release --target ${{ matrix.target }} - gzip -9 ${{ steps.artifact_name.outputs.value }} - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.artifact_name.outputs.value }} - path: "${{ steps.artifact_name.outputs.value }}.gz" - - release: - name: Release - needs: build - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get version tag - uses: olegtarasov/get-tag@v2.1 - id: tag - - name: Release name - id: release - run: | - ref="${{ steps.tag.outputs.tag }}" - echo "::set-output name=value::${ref:1}" - - uses: actions/download-artifact@v2 - with: - path: artifacts - - name: Release - uses: softprops/action-gh-release@v1 - with: - prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'rc') }} - name: ${{ steps.release.outouts.value }} - files: artifacts/**/*.gz - - publish: - name: Publish - needs: release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get version tag - uses: olegtarasov/get-tag@v2.1 - id: tag - - name: Package tag - id: npm_tag - run: | - shopt -s extglob - ref="${{ steps.tag.outputs.tag }}" - case "$ref" in *alpha* ) tag="alpha";; *rc* ) tag="next";; * ) tag="latest";; esac - echo "::set-output name=value::${tag}" - - uses: actions/setup-node@v2 - with: - registry-url: 'https://registry.npmjs.org' - - name: Publish to NPM - run: npm publish --tag ${{ steps.npm_tag.outputs.value }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - uses: actions/setup-node@v2 - with: - registry-url: 'https://npm.pkg.github.com/@gf3' - - name: Publish to GitHub - run: npm publish --tag ${{ steps.npm_tag.outputs.value }} - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea2d553..9e1e2c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,6 +72,11 @@ jobs: - name: Get version tag uses: olegtarasov/get-tag@v2.1 id: tag + - name: Release name + id: release + run: | + ref="${{ steps.tag.outputs.tag }}" + echo "::set-output name=value::${ref:1}" - uses: actions/download-artifact@v2 with: path: artifacts @@ -79,6 +84,7 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'rc') }} + name: ${{ steps.release.outouts.value }} files: artifacts/**/*.gz publish: @@ -107,7 +113,7 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: actions/setup-node@v2 with: - registry-url: 'https://npm.pkg.github.com' + registry-url: 'https://npm.pkg.github.com/@gf3' - name: Publish to GitHub run: npm publish --tag ${{ steps.npm_tag.outputs.value }} env: