Skip to content

Production Release fix/manual_release_per_platform (pushed by KLongmuirHD) #93

Production Release fix/manual_release_per_platform (pushed by KLongmuirHD)

Production Release fix/manual_release_per_platform (pushed by KLongmuirHD) #93

name: Manual Release
run-name: Production Release ${{ github.ref_name }} (pushed by ${{ github.actor }})
env:
IMAGE_NAME: ghcr.io/herodevs/eol-scan
on:
push:
branches:
- fix/manual_release_per_platform
permissions:
contents: read
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- uses: ./.github/actions/verify-version
id: verify-version
- name: Determine Oclif channel
id: determine-oclif-channel
run: |
VERSION=${{ steps.verify-version.outputs.version }}
if [[ "$VERSION" == *"-beta"* ]]; then
echo "oclif_channel=beta" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"-alpha"* ]]; then
echo "oclif_channel=alpha" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"-next"* ]]; then
echo "oclif_channel=next" >> $GITHUB_OUTPUT
else
echo "oclif_channel=stable" >> $GITHUB_OUTPUT
fi
outputs:
version: ${{ steps.verify-version.outputs.version }}
oclif_channel: ${{ steps.determine-oclif-channel.outputs.oclif_channel }}
test:
runs-on: ubuntu-latest
needs: check-version
env:
GRAPHQL_HOST: ${{ secrets.GRAPHQL_HOST }}
EOL_REPORT_URL: ${{ secrets.EOL_REPORT_URL }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run test:e2e
build-standalone:
name: Build Standalone (${{ matrix.target }})
needs: [check-version, test]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: linux-x64
- os: macos-latest
target: darwin-arm64
- os: windows-latest
target: win32-x64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- run: |
echo "Node arch:"
node -p "process.arch"
echo "Machine arch:"
uname -m
# Build
- run: npm ci
- run: npm run build
- name: Pack standalone
shell: bash
run: |
npx oclif pack tarballs \
--targets=${{ matrix.target }} \
--no-xz
- uses: actions/upload-artifact@v4
with:
name: standalone-${{ matrix.target }}
path: dist/*.tar.gz
upload-and-promote:
runs-on: ubuntu-latest
needs: [check-version, build-standalone]
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- name: Flatten artifacts
run: |
mkdir final-dist
find dist -name "*.tar.gz" -exec mv {} final-dist/ \;
- name: '[STUB] Create GitHub Release (draft)'
run: |
echo "STUB: Would create GH release v${{ needs.check-version.outputs.version }}"
ls -lh final-dist/
- name: '[STUB] Upload tarballs to S3'
run: |
echo "STUB: Would upload tarballs to S3 for targets linux-x64,win32-x64,darwin-arm64"
- name: '[STUB] Promote channel'
run: |
echo "STUB: Would promote channel=${{ needs.check-version.outputs.oclif_channel }} version=${{ needs.check-version.outputs.version }}"
- name: '[STUB] Verify channel pointer'
run: |
echo "STUB: Would verify channel pointer for ${{ needs.check-version.outputs.oclif_channel }}"
npm-publish:
runs-on: ubuntu-latest
needs: [check-version, test, upload-and-promote]
steps:
- name: '[STUB] NPM publish'
run: |
echo "STUB: Would publish to npm with tag=${{ needs.check-version.outputs.oclif_channel }}"
publish-images:
name: Publish Images
needs: [npm-publish]
runs-on: ubuntu-latest
steps:
- name: '[STUB] Publish Docker images'
run: |
echo "STUB: Would build and push Docker images to ghcr.io"